Skip to content

Commit bda39b3

Browse files
committed
making a few more updates
1 parent 14df3c9 commit bda39b3

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

app/Actions/TwoFactorAuth/ConfirmTwoFactorAuthentication.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/Http/Controllers/Settings/TwoFactorAuthController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function show(Request $request)
2727
$confirmed = !is_null($user->two_factor_confirmed_at);
2828

2929
// If 2fa is not confirmed, we want to clear out secret and recovery codes
30+
// This happens when a user enables 2fa and does not finish confirmation
3031
if (!$confirmed) {
3132
app(DisableTwoFactorAuthentication::class)($user);
3233
}
@@ -83,11 +84,10 @@ public function confirm(Request $request)
8384

8485
// Update user with recovery codes and confirm 2FA
8586
$request->user()->forceFill([
86-
'two_factor_recovery_codes' => encrypt(json_encode($recoveryCodes))
87+
'two_factor_recovery_codes' => encrypt(json_encode($recoveryCodes)),
88+
'two_factor_confirmed_at' => now()
8789
])->save();
8890

89-
app(ConfirmTwoFactorAuthentication::class)($request->user());
90-
9191
return response()->json([
9292
'status' => 'two-factor-authentication-confirmed',
9393
'recovery_codes' => $recoveryCodes

0 commit comments

Comments
 (0)