Skip to content

Commit

Permalink
fix redirect after oauth login
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Sep 17, 2024
1 parent 386f7a3 commit 6f6179a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Thruk/Controller/login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ sub index {
}
}

# simply redirect if already authenticated
if($has_query && $referer && $c->cookies('thruk_auth') && $c->authenticate()) {
# simply redirect if already authenticated, but only if it looks like a valid url
if($has_query && $referer && $referer =~ m%/thruk/%mx && $c->cookies('thruk_auth') && $c->authenticate()) {
$referer = '/'.$referer if $referer !~ m|^/|mx;
return $c->redirect_to($referer);
}
Expand Down

0 comments on commit 6f6179a

Please sign in to comment.