File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
routers/web/user/setting/security Expand file tree Collapse file tree 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) {
3939 if auth .IsErrTwoFactorNotEnrolled (err ) {
4040 ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
4141 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
42+ } else {
43+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
4244 }
43- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
4445 return
4546 }
4647
@@ -74,8 +75,9 @@ func DisableTwoFactor(ctx *context.Context) {
7475 if auth .IsErrTwoFactorNotEnrolled (err ) {
7576 ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
7677 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
78+ } else {
79+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
7780 }
78- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
7981 return
8082 }
8183
@@ -84,8 +86,9 @@ func DisableTwoFactor(ctx *context.Context) {
8486 // There is a potential DB race here - we must have been disabled by another request in the intervening period
8587 ctx .Flash .Success (ctx .Tr ("settings.twofa_disabled" ))
8688 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
89+ } else {
90+ ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
8791 }
88- ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
8992 return
9093 }
9194
You can’t perform that action at this time.
0 commit comments