[Catalyst-commits] r13627 -
Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin
davewood at dev.catalyst.perl.org
davewood at dev.catalyst.perl.org
Wed Sep 29 15:32:51 GMT 2010
Author: davewood
Date: 2010-09-29 16:32:51 +0100 (Wed, 29 Sep 2010)
New Revision: 13627
Modified:
Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm
Log:
clarify user and user_exists behaviour
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm 2010-09-29 01:34:03 UTC (rev 13626)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm 2010-09-29 15:32:51 UTC (rev 13627)
@@ -863,14 +863,20 @@
=head2 $c->user( )
Returns the currently logged in user, or undef if there is none.
+Normally the user is re-retrieved from the store.
+For L<Catalyst::Authentication::Store::DBIx::Class> the user is re-restored
+using the primary key of the user table.
+Thus B<user> can throw an error even though B<user_exists>
+returned true.
=head2 $c->user_exists( )
Returns true if a user is logged in right now. The difference between
-user_exists and user is that user_exists will return true if a user is logged
+B<user_exists> and B<user> is that user_exists will return true if a user is logged
in, even if it has not been yet retrieved from the storage backend. If you only
need to know if the user is logged in, depending on the storage mechanism this
can be much more efficient.
+B<user_exists> only looks into the session while B<user> is trying to restore the user.
=head2 $c->user_in_realm( $realm )
More information about the Catalyst-commits
mailing list