[Catalyst-commits] r8429 - trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx

jayk at dev.catalyst.perl.org jayk at dev.catalyst.perl.org
Wed Sep 17 21:43:04 BST 2008


Author: jayk
Date: 2008-09-17 21:43:04 +0100 (Wed, 17 Sep 2008)
New Revision: 8429

Modified:
   trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm
Log:
documentation updates in prep for new release


Modified: trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm
===================================================================
--- trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm	2008-09-17 20:33:55 UTC (rev 8428)
+++ trunk/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm	2008-09-17 20:43:04 UTC (rev 8429)
@@ -4,7 +4,7 @@
 use warnings;
 use base qw/Class::Accessor::Fast/;
 
-our $VERSION= "0.104";
+our $VERSION= "0.105";
 
 
 BEGIN {
@@ -127,7 +127,7 @@
         my ( $self, $c ) = @_;
         
         $c->authenticate({  
-                          username => $c->req->params->username,
+                          screen_name => $c->req->params->username,
                           password => $c->req->params->password,
                           status => [ 'registered', 'loggedin', 'active']
                           }))
@@ -187,12 +187,6 @@
 Contains the class name (as passed to $c->model()) of the DBIx::Class schema
 to use as the source for user information.  This config item is B<REQUIRED>.
 
-=item id_field
-
-Contains the field name containing the unique identifier for a user.  This is 
-used when storing and retrieving a user from the session.  The value in this
-field should correspond to a single user in the database.  Defaults to 'id'.
-
 =item role_column
 
 If your role information is stored in the same table as the rest of your user
@@ -250,6 +244,19 @@
 own class to extend the functionality of the existing class.  
 Chances are you do not want to set this.
 
+=item id_field
+
+In most cases, this config variable does not need to be set, as
+Catalyst::Authentication::Store::DBIx::Class will determine the primary
+key of the user table on it's own.  If you need to override the default, 
+or your user table has multiple primary keys, then id_field
+should contain the column name that should be used to restore the user.
+A given value in this column should correspond to a single user in the database.
+Note that this is used B<ONLY> when restoring a user from the session and 
+has no bearing whatsoever in the initial authentication process.  Note also
+that if use_userdata_from_session is enabled, this config parameter
+is not used at all.
+
 =back
 
 =head1 USAGE 
@@ -270,7 +277,7 @@
 is below:
 
     if ($c->authenticate({  
-                          username => $c->req->params->{'username'},
+                          screen_name => $c->req->params->{'username'},
                           password => $c->req->params->{'password'},
                           status => [ 'registered', 'active', 'loggedin']
                          })) {
@@ -278,8 +285,8 @@
         # ... authenticated user code here
     }
 
-The above example would attempt to retrieve a user whose username column
-matched the username provided, and whose status column matched one of the
+The above example would attempt to retrieve a user whose username column (here, 
+screen_name) matched the username provided, and whose status column matched one of the
 values provided. These name => value pairs are used more or less directly in
 the DBIx::Class' search() routine, so in most cases, you can use DBIx::Class
 syntax to retrieve the user according to whatever rules you have.




More information about the Catalyst-commits mailing list