Authentication: modify get_user to pass on extra args to the store
David Kamholz [Sat, 4 Mar 2006 01:26:19 +0000 (01:26 +0000)]
lib/Catalyst/Plugin/Authentication.pm
lib/Catalyst/Plugin/Authentication/Credential/Password.pm

index ab25422..c1a05ce 100644 (file)
@@ -85,10 +85,10 @@ sub logout {
 }
 
 sub get_user {
-    my ( $c, $uid ) = @_;
+    my ( $c, $uid, @rest ) = @_;
 
     if ( my $store = $c->default_auth_store ) {
-        return $store->get_user($uid);
+        return $store->get_user( $uid, @rest );
     }
     else {
         Catalyst::Exception->throw(
index 35c3978..2428795 100644 (file)
@@ -10,7 +10,7 @@ use Catalyst::Exception ();
 use Digest              ();
 
 sub login {
-    my ( $c, $user, $password ) = @_;
+    my ( $c, $user, $password, @rest ) = @_;
 
     for ( $c->request ) {
         unless ( $user ||= $_->param("login")
@@ -36,7 +36,7 @@ sub login {
     unless ( Scalar::Util::blessed($user)
         and $user->isa("Catalyst::Plugin::Authentication::User") )
     {
-        if ( my $user_obj = $c->get_user($user) ) {
+        if ( my $user_obj = $c->get_user( $user, $password, @rest ) ) {
             $user = $user_obj;
         }
         else {