r10518@t0mlaptop (orig r10517): t0m | 2009-06-12 11:27:58 +0100
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Authentication / User.pm
index 36ac802..eeff10e 100644 (file)
@@ -1,12 +1,10 @@
 package Catalyst::Authentication::User;
-
-use strict;
-use warnings;
-use base qw/Class::Accessor::Fast/;
+use Moose;
 use Scalar::Util qw/refaddr/;
+use namespace::autoclean;
 
 ## auth_realm is the realm this user came from. 
-__PACKAGE__->mk_accessors(qw/auth_realm store/);
+has [qw/auth_realm store/] => ( is => 'rw' );
 
 ## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.  
 ## translation - it won't work if you try to use it directly.
@@ -75,13 +73,7 @@ sub AUTOLOAD {
     (my $method) = (our $AUTOLOAD =~ /([^:]+)$/);
     return if $method eq "DESTROY";
 
-    my $obj = $self->obj;
-    # Don't bother unless we have a backing object
-    return if refaddr($obj) eq refaddr($self);
-
-    $obj->$method(@_);
-}
-
+__PACKAGE__->meta->make_immutable;
 __PACKAGE__;
 
 __END__