diff options
Diffstat (limited to 'routers/user/auth.go')
-rw-r--r-- | routers/user/auth.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go index a6d3ace7ba..1692a396cc 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -16,7 +16,6 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/eventsource" - auth "code.gitea.io/gitea/modules/forms" "code.gitea.io/gitea/modules/hcaptcha" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/password" @@ -27,6 +26,7 @@ import ( "code.gitea.io/gitea/modules/web/middleware" "code.gitea.io/gitea/routers/utils" "code.gitea.io/gitea/services/externalaccount" + "code.gitea.io/gitea/services/forms" "code.gitea.io/gitea/services/mailer" "github.com/markbates/goth" @@ -171,7 +171,7 @@ func SignInPost(ctx *context.Context) { return } - form := web.GetForm(ctx).(*auth.SignInForm) + form := web.GetForm(ctx).(*forms.SignInForm) u, err := models.UserSignIn(form.UserName, form.Password) if err != nil { if models.IsErrUserNotExist(err) { @@ -253,7 +253,7 @@ func TwoFactor(ctx *context.Context) { // TwoFactorPost validates a user's two-factor authentication token. func TwoFactorPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.TwoFactorAuthForm) + form := web.GetForm(ctx).(*forms.TwoFactorAuthForm) ctx.Data["Title"] = ctx.Tr("twofa") // Ensure user is in a 2FA session. @@ -309,7 +309,7 @@ func TwoFactorPost(ctx *context.Context) { return } - ctx.RenderWithErr(ctx.Tr("auth.twofa_passcode_incorrect"), tplTwofa, auth.TwoFactorAuthForm{}) + ctx.RenderWithErr(ctx.Tr("auth.twofa_passcode_incorrect"), tplTwofa, forms.TwoFactorAuthForm{}) } // TwoFactorScratch shows the scratch code form for two-factor authentication. @@ -332,7 +332,7 @@ func TwoFactorScratch(ctx *context.Context) { // TwoFactorScratchPost validates and invalidates a user's two-factor scratch token. func TwoFactorScratchPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.TwoFactorScratchAuthForm) + form := web.GetForm(ctx).(*forms.TwoFactorScratchAuthForm) ctx.Data["Title"] = ctx.Tr("twofa_scratch") // Ensure user is in a 2FA session. @@ -375,7 +375,7 @@ func TwoFactorScratchPost(ctx *context.Context) { return } - ctx.RenderWithErr(ctx.Tr("auth.twofa_scratch_token_incorrect"), tplTwofaScratch, auth.TwoFactorScratchAuthForm{}) + ctx.RenderWithErr(ctx.Tr("auth.twofa_scratch_token_incorrect"), tplTwofaScratch, forms.TwoFactorScratchAuthForm{}) } // U2F shows the U2F login page @@ -796,7 +796,7 @@ func LinkAccount(ctx *context.Context) { // LinkAccountPostSignIn handle the coupling of external account with another account using signIn func LinkAccountPostSignIn(ctx *context.Context) { - signInForm := web.GetForm(ctx).(*auth.SignInForm) + signInForm := web.GetForm(ctx).(*forms.SignInForm) ctx.Data["DisablePassword"] = !setting.Service.RequireExternalRegistrationPassword || setting.Service.AllowOnlyExternalRegistration ctx.Data["Title"] = ctx.Tr("link_account") ctx.Data["LinkAccountMode"] = true @@ -881,7 +881,7 @@ func LinkAccountPostSignIn(ctx *context.Context) { // LinkAccountPostRegister handle the creation of a new account for an external account using signUp func LinkAccountPostRegister(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.RegisterForm) + form := web.GetForm(ctx).(*forms.RegisterForm) // TODO Make insecure passwords optional for local accounts also, // once email-based Second-Factor Auth is available ctx.Data["DisablePassword"] = !setting.Service.RequireExternalRegistrationPassword || setting.Service.AllowOnlyExternalRegistration @@ -1089,7 +1089,7 @@ func SignUp(ctx *context.Context) { // SignUpPost response for sign up information submission func SignUpPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.RegisterForm) + form := web.GetForm(ctx).(*forms.RegisterForm) ctx.Data["Title"] = ctx.Tr("sign_up") ctx.Data["SignUpLink"] = setting.AppSubURL + "/user/sign_up" @@ -1584,7 +1584,7 @@ func MustChangePassword(ctx *context.Context) { // MustChangePasswordPost response for updating a user's password after his/her // account was created by an admin func MustChangePasswordPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.MustChangePasswordForm) + form := web.GetForm(ctx).(*forms.MustChangePasswordForm) ctx.Data["Title"] = ctx.Tr("auth.must_change_password") ctx.Data["ChangePasscodeLink"] = setting.AppSubURL + "/user/settings/change_password" if ctx.HasError() { |