@@ -13,7 +13,6 @@ abstract class AbstractMFAChallengeStrategy implements IMFAChallengeStrategy
1313 private const KEY_USER_ID = '2fa_pending_user_id ' ;
1414 private const KEY_PENDING_AT = '2fa_pending_at ' ;
1515 private const KEY_REMEMBER = '2fa_remember ' ;
16- private const KEY_CLIENT_ID = '2fa_pending_client_id ' ;
1716 private const KEY_RECOVERY_ATTEMPTS = '2fa_recovery_attempts ' ;
1817
1918 public function __construct (protected IUserRecoveryCodeRepository $ recovery_code_repository ) {}
@@ -36,7 +35,6 @@ public function getPendingState(): ?array
3635 'user_id ' => $ user_id ,
3736 'pending_at ' => $ pending_at ,
3837 'remember ' => Session::get (self ::KEY_REMEMBER , false ),
39- 'client_id ' => Session::get (self ::KEY_CLIENT_ID ),
4038 ];
4139 }
4240
@@ -45,7 +43,6 @@ public function clearPendingState(): void
4543 Session::remove (self ::KEY_USER_ID );
4644 Session::remove (self ::KEY_PENDING_AT );
4745 Session::remove (self ::KEY_REMEMBER );
48- Session::remove (self ::KEY_CLIENT_ID );
4946 Session::remove (self ::KEY_RECOVERY_ATTEMPTS );
5047 }
5148
@@ -62,23 +59,17 @@ public function verifyRecoveryCode(User $user, string $code): void
6259 throw new AuthenticationException ("Invalid recovery code. " );
6360 }
6461 $ recoveryCode ->markUsed ();
65- $ this ->recovery_code_repository ->add ($ recoveryCode , false );
6662 return ;
6763 }
6864 }
6965 throw new AuthenticationException ("Invalid recovery code. " );
7066 }
7167
72- protected function storePendingState (int $ userId , bool $ remember, ? string $ clientId = null ): void
68+ protected function storePendingState (int $ userId , bool $ remember ): void
7369 {
7470 Session::put (self ::KEY_USER_ID , $ userId );
7571 Session::put (self ::KEY_PENDING_AT , time ());
7672 Session::put (self ::KEY_REMEMBER , $ remember );
77- if (is_null ($ clientId )) {
78- Session::remove (self ::KEY_CLIENT_ID );
79- } else {
80- Session::put (self ::KEY_CLIENT_ID , $ clientId );
81- }
8273 }
8374
8475 public function verifyChallenge (User $ user , string $ code , ?Client $ client = null ): void
0 commit comments