diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 37d518b61231d..c2294cb161240 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -832,8 +832,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; }