[Catalyst-commits] r7236 - trunk/examples/CatalystAdvent/root/2007/pen

jasonk at dev.catalyst.perl.org jasonk at dev.catalyst.perl.org
Wed Dec 5 14:05:08 GMT 2007


Author: jasonk
Date: 2007-12-05 14:05:08 +0000 (Wed, 05 Dec 2007)
New Revision: 7236

Modified:
   trunk/examples/CatalystAdvent/root/2007/pen/8.pod
Log:
Updated inline authentication tutorial to use ->authenticate() instead
of ->login(), and changed references to 'yesterday' to just say 'earlier',
just in case it gets moved and doesn't follow jayks anymore...



Modified: trunk/examples/CatalystAdvent/root/2007/pen/8.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2007/pen/8.pod	2007-12-05 12:12:28 UTC (rev 7235)
+++ trunk/examples/CatalystAdvent/root/2007/pen/8.pod	2007-12-05 14:05:08 UTC (rev 7236)
@@ -1,11 +1,11 @@
 
 =head1 Inline Authentication Without Redirection
 
-Yesterday Jay Kuri covered Adding Authentication to your Catalyst App, which
-showed you how to determine if the user needed to authenticate, and if they
-did to redirect them to a login controller.  Today I'm going to show you
-an alternate approach, one that doesn't require redirection, that just
-handles the login inline.
+Earlier this week Jay Kuri covered Adding Authentication to your Catalyst
+App, which showed you how to determine if the user needed to authenticate,
+and if they did to redirect them to a login controller.  Today I'm going
+to show you an alternate approach, one that doesn't require redirection,
+that just handles the login inline.
 
 Why would you want to handle the login inline, rather than redirecting to a
 login page?  Have you ever had to login to a web application and fill out a
@@ -39,9 +39,10 @@
         my $password = delete $c->request->params->{ '__password' };
         
         if ( $username && $password ) {
-            if ( $c->login( $username, $password ) ) {
-                return 1;
-            }
+            return 1 if $c->authenticate( {
+                username    => $username,
+                password    => $password,
+            } );
             $c->stash->{ 'error_msg' } = 'Incorrect username or password';
         }
         




More information about the Catalyst-commits mailing list