Skip to content

Commit

Permalink
a few more documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 9, 2013
1 parent 67523ed commit ec483e4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -419,8 +419,7 @@ like this.
my $self = shift;

# Redirect to main page with a 302 response if user is not logged in
return 1 if $self->session('user');
$self->redirect_to('index') and return;
return $self->session('user') || !$self->redirect_to('index');
};

# A protected page auto rendering "protected.html.ep"
Expand Down Expand Up @@ -529,8 +528,7 @@ actual action code needs to be changed.

my $logged_in = $r->under(sub {
my $self = shift;
return 1 if $self->session('user');
$self->redirect_to('index') and return;
return $self->session('user') || !$self->redirect_to('index');
});
$logged_in->get('/protected');

Expand Down Expand Up @@ -590,8 +588,7 @@ Once again the actual action code does not change at all.

sub logged_in {
my $self = shift;
return 1 if $self->session('user');
$self->redirect_to('index') and return;
return $self->session('user') || !$self->redirect_to('index');
}

sub logout {
Expand Down

0 comments on commit ec483e4

Please sign in to comment.