Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@
#[FrontpageRoute(verb: 'GET', url: '/logout')]
public function logout() {
$loginToken = $this->request->getCookie('nc_token');
$uid = $this->userSession->getUser()->getUID();

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getUID on possibly null value
if (!is_null($loginToken)) {
$this->config->deleteUserValue($this->userSession->getUser()->getUID(), 'login_token', $loginToken);
$this->config->deleteUserValue($uid, 'login_token', $loginToken);
}
$this->userSession->logout();

$response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute(
'core.login.showLoginForm',
['clear' => true] // this param the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers
));
), Http::STATUS_SEE_OTHER, ['X-User-Id' => $uid]);

$this->session->set('clearingExecutionContexts', '1');
$this->session->close();
Expand Down
Loading