File tree 1 file changed +6
-3
lines changed
routers/web/user/setting/security 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ func RegenerateScratchTwoFactor(ctx *context.Context) {
39
39
if auth .IsErrTwoFactorNotEnrolled (err ) {
40
40
ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
41
41
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
42
+ } else {
43
+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
42
44
}
43
- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
44
45
return
45
46
}
46
47
@@ -74,8 +75,9 @@ func DisableTwoFactor(ctx *context.Context) {
74
75
if auth .IsErrTwoFactorNotEnrolled (err ) {
75
76
ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
76
77
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
78
+ } else {
79
+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
77
80
}
78
- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
79
81
return
80
82
}
81
83
@@ -84,8 +86,9 @@ func DisableTwoFactor(ctx *context.Context) {
84
86
// There is a potential DB race here - we must have been disabled by another request in the intervening period
85
87
ctx .Flash .Success (ctx .Tr ("settings.twofa_disabled" ))
86
88
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
89
+ } else {
90
+ ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
87
91
}
88
- ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
89
92
return
90
93
}
91
94
You can’t perform that action at this time.
0 commit comments