From c01afd584d42ef43ce783fd463b43987d0e99d1e Mon Sep 17 00:00:00 2001 From: Benno Date: Mon, 25 Nov 2019 07:38:05 +0800 Subject: [PATCH] backport v1.10 - Always show Password field on link account sign in page (#9150) --- routers/user/auth.go | 1 + templates/user/auth/signin_inner.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index cb5611e04..3924b0aaf 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -786,6 +786,7 @@ func LinkAccountPostSignIn(ctx *context.Context, signInForm auth.SignInForm) { u, err := models.UserSignIn(signInForm.UserName, signInForm.Password) if err != nil { if models.IsErrUserNotExist(err) { + ctx.Data["user_exists"] = true ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplLinkAccount, &signInForm) } else { ctx.ServerError("UserLinkAccount", err) diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index 07f85c954..a3e71177e 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -15,7 +15,7 @@ - {{if not .DisablePassword}} + {{if or (not .DisablePassword) .LinkAccountMode}}