]> source.dussan.org Git - gitea.git/commitdiff
update #9066 Always show Password field on link account sign in page (#9147)
authorBenno <blueworrybear@gmail.com>
Sun, 24 Nov 2019 20:17:53 +0000 (04:17 +0800)
committertechknowlogick <techknowlogick@gitea.io>
Sun, 24 Nov 2019 20:17:53 +0000 (15:17 -0500)
routers/user/auth.go
templates/user/auth/signin_inner.tmpl

index 1596e11bbbc05c6184596f76a252cd9b3d08dd74..258b5e03d79ae5bb9562911f54a3597ad37216e1 100644 (file)
@@ -788,6 +788,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)
index 90519c439c7687fe60cc77f6fd08861962c1666b..9850058e5eaf2b37756f5d08d988691938de4137 100644 (file)
@@ -15,7 +15,7 @@
                                <label for="user_name">{{.i18n.Tr "home.uname_holder"}}</label>
                                <input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
                        </div>
-                       {{if not .DisablePassword}}
+                       {{if or (not .DisablePassword) .LinkAccountMode}}
                        <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
                                <label for="password">{{.i18n.Tr "password"}}</label>
                                <input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>