Skip to content

Commit

Permalink
Merge pull request #24564 from nextcloud/backport/24552/stable19
Browse files Browse the repository at this point in the history
[stable19] Remember me is not an app_password
  • Loading branch information
rullzer authored Dec 7, 2020
2 parents 71e4066 + ec270ce commit 7bff8a4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,18 @@ public function tryTokenLogin(IRequest $request) {
return false;
}

// Set the session variable so we know this is an app password
$this->session->set('app_password', $token);
try {
$dbToken = $this->tokenProvider->getToken($token);
} catch (InvalidTokenException $e) {
// Can't really happen but better save than sorry
return true;
}

// Remember me tokens are not app_passwords
if ($dbToken->getRemember() === IToken::DO_NOT_REMEMBER) {
// Set the session variable so we know this is an app password
$this->session->set('app_password', $token);
}

return true;
}
Expand Down

0 comments on commit 7bff8a4

Please sign in to comment.