X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FDBIx%2FClass.pm;h=f0ddf9d81a2e0ab380e798496dec9f677a7be4db;hb=f7e6d29fd2b2eb34be2348bc39d30da4befce781;hp=58e185c9fea5ce92593a20f9f3d3f93801f22233;hpb=28aa21688f807846cf1e3a2244396cb516c4370c;p=catagits%2FCatalyst-Authentication-Store-DBIx-Class.git diff --git a/lib/Catalyst/Authentication/Store/DBIx/Class.pm b/lib/Catalyst/Authentication/Store/DBIx/Class.pm index 58e185c..f0ddf9d 100644 --- a/lib/Catalyst/Authentication/Store/DBIx/Class.pm +++ b/lib/Catalyst/Authentication/Store/DBIx/Class.pm @@ -4,7 +4,7 @@ use strict; use warnings; use base qw/Class::Accessor::Fast/; -our $VERSION= "0.104"; +our $VERSION= "0.105"; BEGIN { @@ -127,7 +127,7 @@ This documentation refers to version 0.10. 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 of the store to be used. 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. -=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 @@ overriding this doesn't make much sense unless you are using your 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 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 @@ that should be used to locate the user in question. An example of this usage 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 @@ is below: # ... 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.