[Catalyst-commits] r6870 - trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Wed Sep 12 14:19:24 GMT 2007


Author: bricas
Date: 2007-09-12 14:19:24 +0100 (Wed, 12 Sep 2007)
New Revision: 6870

Modified:
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/Backend.pm
Log:
fix auto_create

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/Backend.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/Backend.pm	2007-09-12 11:50:08 UTC (rev 6869)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/Backend.pm	2007-09-12 13:19:24 UTC (rev 6870)
@@ -34,14 +34,18 @@
     my $user = $self->{auth}{catalyst_user_class}->new( $id, { %{$self} } );
 	$user->id($user->canonical_id);
 
-    if ( $user ) {
-        $user->store( $self );
-        $user->obj->auto_update( $id, @rest ) if $self->{auth}{auto_update_user};
-        return $user;
-    } elsif ( $self->{auth}{auto_create_user} ) {
+
+    if( $self->{auth}{auto_create_user} and !$user->obj ) {
         $self->{auth}{user_class}->auto_create( $id, @rest ) and return $self->get_user( $id );
     }
-    return undef;
+
+    $user->store( $self );
+
+    if( $self->{auth}{auto_update_user} && $user->obj ) {
+        $user->obj->auto_update( $id, @rest );
+    }
+
+    return $user;
 }
 
 sub user_supports {




More information about the Catalyst-commits mailing list