TypeKey: $store->get_user( \%params, \%result ) made into $store->get( $username...
Yuval Kogman [Sun, 11 Dec 2005 13:36:10 +0000 (13:36 +0000)]
Changes [new file with mode: 0644]
lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm
t/basic.t

diff --git a/Changes b/Changes
new file mode 100644 (file)
index 0000000..a1c87e1
--- /dev/null
+++ b/Changes
@@ -0,0 +1,3 @@
+0.03
+        - $store->get_user now gets the user name as the first arg for maximum
+          compatibility.
index 27255b3..afdc39a 100644 (file)
@@ -73,7 +73,7 @@ sub authenticate_typekey {
 
         if ( !$user and my $store = $config->{auth_store} ) {
             $store = $c->get_auth_store($store) unless ref $store;
-            $user = $store->get_user( $p, $res );
+            $user = $store->get_user( $res->{name}, $p, $res );
         }
 
         if ( !$user ) {
@@ -192,7 +192,7 @@ A store (or store name) to retrieve the user from.
 
 When a user is successfully authenticated it will call this:
 
-       $store->get_user( $parameters, $result_of_verify );
+       $store->get_user( $name, $parameters, $result_of_verify );
 
 Where C<$parameters> is a the hash reference passed to
 L<Authen::TypeKey/verify>, and C<$result_of_verify> is the value returned by
index 3164863..dd1b277 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -43,7 +43,7 @@ $tk->mock(
 
 my $store = Test::MockObject->new;
 $store->mock( get_user =>
-      sub { shift; Catalyst::Plugin::Authentication::User::Hash->new(@_) } );
+      sub { shift; Catalyst::Plugin::Authentication::User::Hash->new($_[2]) } );
 
 my $c = Test::MockObject::Extends->new($m);
 $c->set_always( config => {} );