mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-26 02:10:04 +08:00
parent
0d11ba93dd
commit
bf53ab26fa
|
@ -33,8 +33,9 @@ func RegenerateScratchTwoFactor(ctx *context.Context) {
|
||||||
if auth.IsErrTwoFactorNotEnrolled(err) {
|
if auth.IsErrTwoFactorNotEnrolled(err) {
|
||||||
ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled"))
|
ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled"))
|
||||||
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
||||||
|
} else {
|
||||||
|
ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err)
|
||||||
}
|
}
|
||||||
ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +64,9 @@ func DisableTwoFactor(ctx *context.Context) {
|
||||||
if auth.IsErrTwoFactorNotEnrolled(err) {
|
if auth.IsErrTwoFactorNotEnrolled(err) {
|
||||||
ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled"))
|
ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled"))
|
||||||
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
||||||
|
} else {
|
||||||
|
ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err)
|
||||||
}
|
}
|
||||||
ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,8 +75,9 @@ func DisableTwoFactor(ctx *context.Context) {
|
||||||
// There is a potential DB race here - we must have been disabled by another request in the intervening period
|
// There is a potential DB race here - we must have been disabled by another request in the intervening period
|
||||||
ctx.Flash.Success(ctx.Tr("settings.twofa_disabled"))
|
ctx.Flash.Success(ctx.Tr("settings.twofa_disabled"))
|
||||||
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
|
||||||
|
} else {
|
||||||
|
ctx.ServerError("SettingsTwoFactor: Failed to DeleteTwoFactorByID", err)
|
||||||
}
|
}
|
||||||
ctx.ServerError("SettingsTwoFactor: Failed to DeleteTwoFactorByID", err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user