diff --git a/src/Events/RecoveryCodeReplaced.php b/src/Events/RecoveryCodeReplaced.php index 12fc311..3486b91 100644 --- a/src/Events/RecoveryCodeReplaced.php +++ b/src/Events/RecoveryCodeReplaced.php @@ -2,11 +2,12 @@ namespace Laravel\Fortify\Events; +use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; class RecoveryCodeReplaced { - use SerializesModels; + use Dispatchable, SerializesModels; /** * The authenticated user. diff --git a/src/TwoFactorAuthenticatable.php b/src/TwoFactorAuthenticatable.php index 91d6ee3..ae56107 100644 --- a/src/TwoFactorAuthenticatable.php +++ b/src/TwoFactorAuthenticatable.php @@ -9,6 +9,7 @@ use BaconQrCode\Renderer\RendererStyle\RendererStyle; use BaconQrCode\Writer; use Laravel\Fortify\Contracts\TwoFactorAuthenticationProvider; +use Laravel\Fortify\Events\RecoveryCodeReplaced; trait TwoFactorAuthenticatable { @@ -52,6 +53,8 @@ public function replaceRecoveryCode($code) decrypt($this->two_factor_recovery_codes) )), ])->save(); + + RecoveryCodeReplaced::dispatch($this, $code); } /**