Skip to content

Commit

Permalink
Merge pull request #919 from warren5236/redirect-to-home-page-when-lo…
Browse files Browse the repository at this point in the history
…ggin-in-from-not-logged-in

Redirect check so redirect to /not-allowed sends the user back to /
  • Loading branch information
iansltx authored Apr 24, 2024
2 parents d2f8cd5 + b827129 commit e08915a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/User/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,11 @@ 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 e08915a

Please sign in to comment.