Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
user logout (controller, and option in template)
  • Loading branch information
garu committed Jun 13, 2010
1 parent 7035cf7 commit 9c3cee4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tweetylicious.pl
Expand Up @@ -110,6 +110,14 @@ package main;
} => 'login';


# user logout is just a matter of expiring the session
get '/logout' => sub {
my $self = shift;
$self->session( expires => 1);
$self->redirect_to('/');
};


# let's rock and roll!
shagadelic;

Expand All @@ -133,7 +141,11 @@ package main;
<body>
<div id="header"><a href="/"><div id="logo">Tweetylicious!</div></a>
<div class="options">
% if (session 'name') {
<a href="/<%= session 'name' %>">Home</a><a href="/logout">Sign-Out</a>
% } else {
<a href="/login">Sign-In</a><a href="/join">Join us!</a>
% }
</div>
</div>
Expand Down

0 comments on commit 9c3cee4

Please sign in to comment.