mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-10 18:01:53 +02:00
Style preference tab for user (#467)
This commit is contained in:
@ -14,7 +14,7 @@ func BeginTotp(ctx *context.Context) error {
|
||||
return ctx.ErrorRes(500, "Cannot check for user MFA", err)
|
||||
} else if hasTotp {
|
||||
ctx.AddFlash(ctx.Tr("auth.totp.already-enabled"), "error")
|
||||
return ctx.RedirectTo("/settings")
|
||||
return ctx.RedirectTo("/settings/mfa")
|
||||
}
|
||||
|
||||
ogUrl, err := url.Parse(ctx.GetData("baseHttpUrl").(string))
|
||||
@ -47,7 +47,7 @@ func FinishTotp(ctx *context.Context) error {
|
||||
return ctx.ErrorRes(500, "Cannot check for user MFA", err)
|
||||
} else if hasTotp {
|
||||
ctx.AddFlash(ctx.Tr("auth.totp.already-enabled"), "error")
|
||||
return ctx.RedirectTo("/settings")
|
||||
return ctx.RedirectTo("/settings/mfa")
|
||||
}
|
||||
|
||||
dto := &db.TOTPDTO{}
|
||||
@ -134,7 +134,7 @@ func AssertTotp(ctx *context.Context) error {
|
||||
}
|
||||
|
||||
ctx.AddFlash(ctx.Tr("auth.totp.code-used", dto.Code), "warning")
|
||||
redirectUrl = "/settings"
|
||||
redirectUrl = "/settings/mfa"
|
||||
}
|
||||
|
||||
sess.Values["user"] = userId
|
||||
@ -157,7 +157,7 @@ func DisableTotp(ctx *context.Context) error {
|
||||
}
|
||||
|
||||
ctx.AddFlash(ctx.Tr("auth.totp.disabled"), "success")
|
||||
return ctx.RedirectTo("/settings")
|
||||
return ctx.RedirectTo("/settings/mfa")
|
||||
}
|
||||
|
||||
func RegenerateTotpRecoveryCodes(ctx *context.Context) error {
|
||||
|
Reference in New Issue
Block a user