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 ),
$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 );
}
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