Skip to content

Commit

Permalink
Ensure all redirects use uri_for().
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 28, 2016
1 parent e4cd146 commit 8e880f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Lystyng.pm
Expand Up @@ -80,8 +80,8 @@ prefix '/list' => sub {

$user->add_to_lists($list_data);

redirect '/user/' . $user->username .
'/list/' . $list_data->{slug};
redirect uri_for('/user/' . $user->username .
'/list/' . $list_data->{slug});
};
};

Expand Down Expand Up @@ -126,7 +126,7 @@ post '/register' => sub {

session user => $user;

redirect '/user/' . $user->username;
redirect uri_for('/user/' . $user->username);
};

get '/login' => sub {
Expand All @@ -138,7 +138,7 @@ post '/login' => sub {
my ($user) = $user_rs->find({ username => body_parameters->get('username') });
if ($user && $user->check_password(body_parameters->get('password'))) {
session user => $user;
redirect '/user/' . $user->username;
redirect uri_for('/user/' . $user->username);
} else {
template 'login', {
error => 1,
Expand All @@ -148,7 +148,7 @@ post '/login' => sub {

get '/logout' => sub {
session user => undef;
redirect '/';
redirect uri_for('/');
};

1;

0 comments on commit 8e880f7

Please sign in to comment.