From c1b3feaed871f529cfa062d85a4e8acc68f4c606 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 26 Oct 2021 15:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/user/auth.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index d9811bd83..44c5ad97d 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -215,7 +215,7 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { } return } - log.Info("Go this 1.") + models.SaveLoginInfoToDb(ctx.Req.Request, u) // If this user is enrolled in 2FA, we can't sign the user in just yet. // Instead, redirect them to the 2FA authentication page. _, err = models.GetTwoFactorByUID(u.ID) @@ -225,10 +225,8 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { } else { ctx.ServerError("UserSignIn", err) } - log.Info("Go this 1-1.") return } - log.Info("Go this 2.") // User needs to use 2FA, save data and redirect to 2FA page. if err := ctx.Session.Set("twofaUid", u.ID); err != nil { ctx.ServerError("UserSignIn: Unable to set twofaUid in session", err) @@ -242,14 +240,12 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { ctx.ServerError("UserSignIn: Unable to save session", err) return } - log.Info("Go this 3.") regs, err := models.GetU2FRegistrationsByUID(u.ID) if err == nil && len(regs) > 0 { ctx.Redirect(setting.AppSubURL + "/user/u2f") return } - log.Info("Go this 4.") - models.SaveLoginInfoToDb(ctx.Req.Request, u) + ctx.Redirect(setting.AppSubURL + "/user/two_factor") }