Skip to content

Commit

Permalink
backport v1.10 - Always show Password field on link account sign in p…
Browse files Browse the repository at this point in the history
…age (#9150)
  • Loading branch information
blueworrybear authored and techknowlogick committed Nov 24, 2019
1 parent 1270e2a commit c01afd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions routers/user/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion templates/user/auth/signin_inner.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit c01afd5

Please sign in to comment.