Merge pull request #24563 from nextcloud/backport/24552/stable20

[stable20] Remember me is not an app_password
This commit is contained in:
Roeland Jago Douma 2020-12-07 11:52:17 +01:00 committed by GitHub
commit b9011c1d1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -832,8 +832,18 @@ class Session implements IUserSession, Emitter {
return false; return false;
} }
// Set the session variable so we know this is an app password try {
$this->session->set('app_password', $token); $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; return true;
} }