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 @@ -33,8 +33,9 @@ func RegenerateScratchTwoFactor(ctx *context.Context) {
33
33
if auth .IsErrTwoFactorNotEnrolled (err ) {
34
34
ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
35
35
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
36
+ } else {
37
+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
36
38
}
37
- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
38
39
return
39
40
}
40
41
@@ -63,8 +64,9 @@ func DisableTwoFactor(ctx *context.Context) {
63
64
if auth .IsErrTwoFactorNotEnrolled (err ) {
64
65
ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
65
66
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
67
+ } else {
68
+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
66
69
}
67
- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
68
70
return
69
71
}
70
72
@@ -73,8 +75,9 @@ func DisableTwoFactor(ctx *context.Context) {
73
75
// There is a potential DB race here - we must have been disabled by another request in the intervening period
74
76
ctx .Flash .Success (ctx .Tr ("settings.twofa_disabled" ))
75
77
ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
78
+ } else {
79
+ ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
76
80
}
77
- ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
78
81
return
79
82
}
80
83
You can’t perform that action at this time.
0 commit comments