Show either sign up OR sign in
This commit is contained in:
parent
2e2eacf62a
commit
664786040b
|
@ -664,8 +664,23 @@ func LinkAccount(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Data["user_name"] = gothUser.(goth.User).NickName
|
uname := gothUser.(goth.User).NickName
|
||||||
ctx.Data["email"] = gothUser.(goth.User).Email
|
email := gothUser.(goth.User).Email
|
||||||
|
ctx.Data["user_name"] = uname
|
||||||
|
ctx.Data["email"] = email
|
||||||
|
|
||||||
|
if "" != uname {
|
||||||
|
u, _ := models.GetUserByName(uname)
|
||||||
|
if u != nil {
|
||||||
|
ctx.Data["user_name_exists"] = "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if "" != email {
|
||||||
|
u, _ := models.GetUserByEmail(email)
|
||||||
|
if u != nil {
|
||||||
|
ctx.Data["email_exists"] = "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ctx.HTML(200, tplLinkAccount)
|
ctx.HTML(200, tplLinkAccount)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if or .user_name_exists .email_exists}}
|
||||||
<div class="ui user signin container icon">
|
<div class="ui user signin container icon">
|
||||||
{{template "user/auth/signin_inner" .}}
|
{{template "user/auth/signin_inner" .}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
{{template "user/auth/signup_inner" .}}
|
{{template "user/auth/signup_inner" .}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
{{template "base/footer" .}}
|
{{template "base/footer" .}}
|
||||||
|
|
Loading…
Reference in New Issue