File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,16 @@ class DisableTwoFactorAuthentication
15
15
*/
16
16
public function __invoke ($ user )
17
17
{
18
- $ user ->forceFill ([
19
- 'two_factor_secret ' => null ,
20
- 'two_factor_recovery_codes ' => null ,
21
- ] + (Fortify::confirmsTwoFactorAuthentication () ? [
22
- 'two_factor_confirmed_at ' => null ,
23
- ] : []))->save ();
18
+ if (! is_null ($ user ->two_factor_secret ) ||
19
+ ! is_null ($ user ->two_factor_recovery_codes ) ||
20
+ ! is_null ($ user ->two_factor_confirmed_at )) {
21
+ $ user ->forceFill ([
22
+ 'two_factor_secret ' => null ,
23
+ 'two_factor_recovery_codes ' => null ,
24
+ ] + (Fortify::confirmsTwoFactorAuthentication () ? [
25
+ 'two_factor_confirmed_at ' => null ,
26
+ ] : []))->save ();
27
+ }
24
28
25
29
TwoFactorAuthenticationDisabled::dispatch ($ user );
26
30
}
You can’t perform that action at this time.
0 commit comments