diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2024-10-28 10:14:29 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-11-05 11:14:04 +0100 |
commit | 381a2aa627dc99a353b9f6b4a75677811ee7d22b (patch) | |
tree | bb65e1e71cc0f639e852bd31df69194f242b8c64 /lib | |
parent | 46abfc6d5094b65d8595a2d9c69d76ea34f23f16 (diff) | |
download | nextcloud-server-381a2aa627dc99a353b9f6b4a75677811ee7d22b.tar.gz nextcloud-server-381a2aa627dc99a353b9f6b4a75677811ee7d22b.zip |
fix: Clear pending two factor tokens also from configuration
Otherwise as the tokens were removed from the database but not from the
configuration the next time that the tokens were cleared the previous
tokens were still got from the configuration, and trying to remove them
again from the database ended in a DoesNotExistException being thrown.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Authentication/TwoFactorAuth/Manager.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 072ffc4f86f..74a19ebc718 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -366,6 +366,8 @@ class Manager { $tokensNeeding2FA = $this->config->getUserKeys($userId, 'login_token_2fa'); foreach ($tokensNeeding2FA as $tokenId) { + $this->config->deleteUserValue($userId, 'login_token_2fa', $tokenId); + $this->tokenProvider->invalidateTokenById($userId, (int)$tokenId); } } |