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

jasonk at dev.catalyst.perl.org jasonk at dev.catalyst.perl.org
Wed Dec 5 18:09:50 GMT 2007


Author: jasonk
Date: 2007-12-05 18:09:50 +0000 (Wed, 05 Dec 2007)
New Revision: 7237

Modified:
   trunk/examples/CatalystAdvent/root/2007/pen/8.pod
Log:
Oops, found a little bug in the code for one of my advent entries...
Can't detach out of an action you forwarded to.


Modified: trunk/examples/CatalystAdvent/root/2007/pen/8.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2007/pen/8.pod	2007-12-05 14:05:08 UTC (rev 7236)
+++ trunk/examples/CatalystAdvent/root/2007/pen/8.pod	2007-12-05 18:09:50 UTC (rev 7237)
@@ -47,28 +47,9 @@
         }
         
         $c->stash->{ 'template' } = 'auth/login.tt2';
-        $c->detach( 'View::TT' );
+        return 0;
     }
 
-You can also throw in a regular old login method, in case you need somewhere
-to link to when someone clicks a login button in the applications header or
-something like that.
-
-    sub login : Local {
-        my ( $self, $c ) = @_;
-        
-        $c->forward( 'check_login' );
-    }
-
-And for good measure, put a logout action in here too.
-
-    sub logout : Local {
-        my ( $self, $c ) = @_;
-        
-        $c->logout;
-        $c->response->redirect( $c->uri_for( '/' ) );
-    }
-
 =head2 The login template
 
 To go along with your controller, you need a login template, in
@@ -105,7 +86,7 @@
     sub auto : Private {
         my ( $self, $c ) = @_;
         
-        $c->forward( '/auth/check_login' );
+        $c->forward( '/auth/check_login' ) || return 0;
         return 1;
     }
 




More information about the Catalyst-commits mailing list