use warnings;
use base qw/Class::Accessor::Fast/;
-our $VERSION= "0.104";
+our $VERSION= "0.105";
BEGIN {
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']
}))
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
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
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']
})) {
# ... 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.