Doc update for latest TypeKey goodness
[catagits/Catalyst-Authentication-Credential-HTTP-Proxy.git] / lib / Catalyst / Plugin / Authentication / Credential / TypeKey.pm
index 4d9df06..4e6ecd2 100644 (file)
@@ -18,8 +18,8 @@ sub setup {
     my $config = $c->config->{authentication}{typekey} ||= {};
 
     $config->{typekey_object} ||= do {
-        $config->{user_class} ||=
-          "Catalyst::Plugin::Authentication::User::Hash";
+        ( $config->{user_class} ||=
+          "Catalyst::Plugin::Authentication::User::Hash" )->require;
 
         $config->{key_cache} ||=
           File::Spec->catfile( Catalyst::Utils::class2tempdir( $c, 1 ),
@@ -58,9 +58,9 @@ sub authenticate_typekey {
             $store = $c->get_auth_store($store) unless ref $store;
             $user = $store->get_user( $p, $res );
         }
-        else {
+
+               if ( !$user ) {
             my $user_class = $config->{user_class};
-            $user_class->require or die $@;
             $user = $user_class->new( $res );
         }
 
@@ -198,10 +198,14 @@ Where C<$parameters> is a the hash reference passed to
 L<Authen::TypeKey/verify>, and C<$result_of_verify> is the value returned by
 L<Authen::TypeKey/verify>.
 
+If this is unset, L<Catalyst::Plugin::Authentication/default_auth_store> will
+be used instead.
+
 =item user_class
 
-If C<auth_store> is not set it will use this class to instantiate an object,
-calling C<new> on the class with the same C<$parameters> hash ref.
+If C<auth_store> or the default store returns nothing from get_user, this class
+will be used to instantiate an object by calling C<new> on the class with the
+return value from L<Authen::TypeKey/verify>.
 
 =back