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 @@ -33,8 +33,9 @@ func RegenerateScratchTwoFactor(ctx *context.Context) {
3333 if auth .IsErrTwoFactorNotEnrolled (err ) {
3434 ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
3535 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
36+ } else {
37+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
3638 }
37- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
3839 return
3940 }
4041
@@ -63,8 +64,9 @@ func DisableTwoFactor(ctx *context.Context) {
6364 if auth .IsErrTwoFactorNotEnrolled (err ) {
6465 ctx .Flash .Error (ctx .Tr ("settings.twofa_not_enrolled" ))
6566 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
67+ } else {
68+ ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
6669 }
67- ctx .ServerError ("SettingsTwoFactor: Failed to GetTwoFactorByUID" , err )
6870 return
6971 }
7072
@@ -73,8 +75,9 @@ func DisableTwoFactor(ctx *context.Context) {
7375 // There is a potential DB race here - we must have been disabled by another request in the intervening period
7476 ctx .Flash .Success (ctx .Tr ("settings.twofa_disabled" ))
7577 ctx .Redirect (setting .AppSubURL + "/user/settings/security" )
78+ } else {
79+ ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
7680 }
77- ctx .ServerError ("SettingsTwoFactor: Failed to DeleteTwoFactorByID" , err )
7881 return
7982 }
8083
You can’t perform that action at this time.
0 commit comments