Skip to content

Commit

Permalink
Remove 'two_factor_auth_configuring' after verify success
Browse files Browse the repository at this point in the history
Signed-off-by: Michiel de Jong <michiel@pondersource.com>
  • Loading branch information
michielbdejong committed Nov 22, 2023
1 parent 9988e59 commit d7cb86a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/private/Authentication/TwoFactorAuth/Manager.php
Expand Up @@ -263,6 +263,7 @@ public function verifyChallenge(string $providerId, IUser $user, string $challen
$this->session->remove(self::SESSION_UID_KEY);
$this->session->remove(self::REMEMBER_LOGIN);
$this->session->set(self::SESSION_UID_DONE, $user->getUID());
$this->session->remove(self::SESSION_UID_CONFIGURING);

// Clear token from db
$sessionId = $this->session->getId();
Expand Down
5 changes: 3 additions & 2 deletions tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
Expand Up @@ -369,11 +369,12 @@ public function testVerifyChallenge() {
->method('get')
->with('two_factor_remember_login')
->willReturn(false);
$this->session->expects($this->exactly(2))
$this->session->expects($this->exactly(3))
->method('remove')
->withConsecutive(
['two_factor_auth_uid'],
['two_factor_remember_login']
['two_factor_remember_login'],
['two_factor_auth_configuring']
);
$this->session->expects($this->once())
->method('set')
Expand Down

0 comments on commit d7cb86a

Please sign in to comment.