diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-01-22 16:14:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 16:14:45 +0100 |
commit | 47b10c3775cf3d431ec8375285c1c607e209bc96 (patch) | |
tree | 45330d983a0663a361df659f5120b7433d5bce10 /lib | |
parent | 257e7c4b5160b7e6ff0004335975dc278c5212e9 (diff) | |
parent | 99d525eb36d8e3e14dbf72f5fb66b8554dce357c (diff) | |
download | nextcloud-server-47b10c3775cf3d431ec8375285c1c607e209bc96.tar.gz nextcloud-server-47b10c3775cf3d431ec8375285c1c607e209bc96.zip |
Merge pull request #25275 from nextcloud/fix/two-factor-token-type
Convert 2FA token type to string
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Authentication/TwoFactorAuth/Manager.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 0a60606ad65..d95cc8b1ebf 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -339,7 +339,7 @@ class Manager { $tokenId = $token->getId(); $tokensNeeding2FA = $this->config->getUserKeys($user->getUID(), 'login_token_2fa'); - if (!\in_array($tokenId, $tokensNeeding2FA, true)) { + if (!\in_array((string) $tokenId, $tokensNeeding2FA, true)) { $this->session->set(self::SESSION_UID_DONE, $user->getUID()); return false; } @@ -376,14 +376,14 @@ class Manager { $id = $this->session->getId(); $token = $this->tokenProvider->getToken($id); - $this->config->setUserValue($user->getUID(), 'login_token_2fa', $token->getId(), $this->timeFactory->getTime()); + $this->config->setUserValue($user->getUID(), 'login_token_2fa', (string) $token->getId(), $this->timeFactory->getTime()); } public function clearTwoFactorPending(string $userId) { $tokensNeeding2FA = $this->config->getUserKeys($userId, 'login_token_2fa'); foreach ($tokensNeeding2FA as $tokenId) { - $this->tokenProvider->invalidateTokenById($userId, $tokenId); + $this->tokenProvider->invalidateTokenById($userId, (int)$tokenId); } } } |