Skip to content

Commit

Permalink
ENH Disable temporary sudo mode after login
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Feb 10, 2025
1 parent 506aef4 commit efb2feb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Authenticator/LoginHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ public function redirectAfterSuccessfulLogin(): HTTPResponse
}
$request->getSession()->clear(static::SESSION_KEY . '.mustLogin');

// Deactivate sudo mode that was activated in doLogin()
$service = $this->getSudoModeService();
// Check if the service has a deactivate method, because it is not defined on the interface
if (method_exists($service, 'deactivate')) {
call_user_func([$service, 'deactivate'], $this->getRequest()->getSession());
}

// Delegate to parent logic
return parent::redirectAfterSuccessfulLogin();
}
Expand Down

0 comments on commit efb2feb

Please sign in to comment.