minor tweaks and note to self
Jay Kuri [Mon, 27 Nov 2006 08:22:42 +0000 (08:22 +0000)]
lib/Catalyst/Plugin/Authentication/Store/DBIx/Class/Backend.pm

index b5a38bb..b5f6f09 100644 (file)
@@ -8,7 +8,7 @@ sub new {
     my ( $class, $config, $app ) = @_;
 
     ## figure out if we are overriding the default store user class.
-    my $storeclass = $config->{'store_user_class'} || "Catalyst::Plugin::Authentication::Store::DBIx::Class::User";
+    my $storeuserclass = $config->{'store_user_class'} || "Catalyst::Plugin::Authentication::Store::DBIx::Class::User";
     
     ## fields can be specified to be ignored during user location.  This allows
     ## authinfo to contain the user info required to find the user, as well as the password
@@ -18,18 +18,23 @@ sub new {
     push @{$config->{'ignore_fields_in_find'}}, ('searchargs', 'ignore_fields');
     
     ## make sure the store class is loaded.
-    Catalyst::Utils::ensure_class_loaded( $storeclass );
+    Catalyst::Utils::ensure_class_loaded( $storeuserclass );
     
     my $self = {};
-    $self->{config} = $config;
-    $self->{store_user_class} = $storeclass;
+    $self->{'config'} = $config;
+    $self->{'store_user_class'} = $storeuserclass;
     
-    #$self->{role_relation} ||= 'roles';
-    #$self->{role_field} ||= 'role';
+    #$self->{'role_relation'} ||= 'roles';
+    #$self->{'role_field'} ||= 'role';
 
     bless $self, $class;
 }
 
+## --jk note to self:
+## let's use DBICs get_columns method to return a hash and save / restore that
+## from the session.  Then we can respond to get() calls, etc. in most cases without
+## resorting to a DB call.  If user_object is called, THEN we can hit the DB and
+## return a real object.  
 sub from_session {
     my ( $self, $c, $frozenuser ) = @_;