diff --git a/src/Actions/ConfirmTwoFactorAuthentication.php b/src/Actions/ConfirmTwoFactorAuthentication.php index 485a95c..3c238f2 100644 --- a/src/Actions/ConfirmTwoFactorAuthentication.php +++ b/src/Actions/ConfirmTwoFactorAuthentication.php @@ -22,7 +22,7 @@ public function __construct(protected TwoFactorProvider $provider) * * @param \App\Models\User $user */ - public function __invoke($user, string $code, ?string $method): void + public function __invoke($user, string $code, ?string $method = null): void { if (empty($user->two_factor_secret) || empty($code) diff --git a/src/TwoFactorAuthenticatable.php b/src/TwoFactorAuthenticatable.php index e610457..3934c58 100644 --- a/src/TwoFactorAuthenticatable.php +++ b/src/TwoFactorAuthenticatable.php @@ -103,7 +103,7 @@ public function disableTwoFactorAuthentication(): void /** * Confirm two-factor authentication for the user. */ - public function confirmTwoFactorAuthentication(string $code, ?string $method): void + public function confirmTwoFactorAuthentication(string $code, ?string $method = null): void { app(ConfirmTwoFactorAuthentication::class)($this, $code, $method); }