diff --git a/src/config/two_factor_auth.php b/src/config/two_factor_auth.php index bc144d8..34f73b4 100644 --- a/src/config/two_factor_auth.php +++ b/src/config/two_factor_auth.php @@ -10,14 +10,20 @@ * Set in days when the one-time-password expires * 0 means it never expires */ - '2fa_expires' => 0, + '2fa_expires' => 60, /* * Name of checkbox input to remember users in your login form * This will be used to save a cookie to remember 2FA for that user as well. + * Check carefully "always_remember_one_time_pass" which will override this value. */ 'remember_input_name' => 'remember', + /* + * If true, we will ignore the "remember me" input and always remember one time password + */ + 'always_remember_one_time_pass' => false, + /* * Name of the route where you want to redirect users after successful validation */ diff --git a/src/listeners/TwoFactorAuthLoginListener.php b/src/listeners/TwoFactorAuthLoginListener.php index 651b06b..9139203 100755 --- a/src/listeners/TwoFactorAuthLoginListener.php +++ b/src/listeners/TwoFactorAuthLoginListener.php @@ -11,7 +11,7 @@ public function handle(): void { $remember = Request::get(config('two_factor_auth.remember_input_name'), false); - if ($remember) { + if ($remember || config('two_factor_auth.always_remember_one_time_pass')) { Session::put(config('two_factor_auth.remember_key'), true); } }