From 3313a0c36dc7401ab62c08230e7a1fde6b909fb7 Mon Sep 17 00:00:00 2001 From: Cawe Coy Rodrigues Marega Date: Fri, 6 Dec 2024 16:20:34 -0300 Subject: [PATCH] Fix email 2FA users_email_unique error #61 --- src/Pages/TwoFactor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pages/TwoFactor.php b/src/Pages/TwoFactor.php index 95e6ffd..ad95e06 100644 --- a/src/Pages/TwoFactor.php +++ b/src/Pages/TwoFactor.php @@ -13,6 +13,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Illuminate\Validation\ValidationException; +use Illuminate\Validation\Rule; use Laravel\Fortify\Actions\ConfirmTwoFactorAuthentication; use Laravel\Fortify\Actions\DisableTwoFactorAuthentication; use Laravel\Fortify\Actions\EnableTwoFactorAuthentication; @@ -251,7 +252,7 @@ private function getConfirmableFields(): array 'name' => 'email', 'label' => __('Email'), 'default' => $this->user->email, - 'rules' => ['required', 'email'], + 'rules' => ['required', 'email', Rule::unique('users', 'email')->ignore($this->user->id)], ]; break;