Skip to content

Commit f0862dc

Browse files
authored
Merge pull request #24552 from nextcloud/enh/remember_me_is_not_app_password
Remember me is not an app_password
2 parents 0d7819e + 5cc348a commit f0862dc

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/private/User/Session.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,18 @@ public function tryTokenLogin(IRequest $request) {
832832
return false;
833833
}
834834

835-
// Set the session variable so we know this is an app password
836-
$this->session->set('app_password', $token);
835+
try {
836+
$dbToken = $this->tokenProvider->getToken($token);
837+
} catch (InvalidTokenException $e) {
838+
// Can't really happen but better save than sorry
839+
return true;
840+
}
841+
842+
// Remember me tokens are not app_passwords
843+
if ($dbToken->getRemember() === IToken::DO_NOT_REMEMBER) {
844+
// Set the session variable so we know this is an app password
845+
$this->session->set('app_password', $token);
846+
}
837847

838848
return true;
839849
}

0 commit comments

Comments
 (0)