Skip to content

Commit

Permalink
Added a redirect check so redirect to /not-allowed sends the user bac…
Browse files Browse the repository at this point in the history
…k to /
  • Loading branch information
warren5236 committed Oct 6, 2023
1 parent d2f8cd5 commit 72dc1fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/User/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,12 @@ protected function handleLogin($result, $redirect = '')
$user = $userApi->getUser($result->user_uri);
if ($user) {
$_SESSION['user'] = $user;
if (empty($redirect) || strpos($redirect, '/user/login') === 0) {

if (
empty($redirect)
|| strpos($redirect, '/user/login') === 0
|| strpos($redirect, '/not-allowed') === 0
) {
$this->application->redirect('/');
}
$this->application->redirect($redirect);
Expand Down

0 comments on commit 72dc1fe

Please sign in to comment.