changes as per discussion
This commit is contained in:
parent
996c9cbab3
commit
5a42829dbd
|
@ -4,12 +4,6 @@ home = Home
|
||||||
dashboard = Dashboard
|
dashboard = Dashboard
|
||||||
explore = Explore
|
explore = Explore
|
||||||
help = Help
|
help = Help
|
||||||
auth_link_signup_tab = Register New Account
|
|
||||||
auth_link_signup_title = Add Email and Password (for Account Recovery)
|
|
||||||
auth_link_signup_submit = Complete Account
|
|
||||||
auth_link_signin_tab = Link to Existing Account
|
|
||||||
auth_link_signin_title = Sign In to Authorize Linked Account
|
|
||||||
auth_link_signin_submit = Link Account
|
|
||||||
sign_in = Sign In
|
sign_in = Sign In
|
||||||
sign_in_with = Sign In With
|
sign_in_with = Sign In With
|
||||||
sign_out = Sign Out
|
sign_out = Sign Out
|
||||||
|
@ -228,6 +222,12 @@ twofa_passcode_incorrect = Your passcode is incorrect. If you misplaced your dev
|
||||||
twofa_scratch_token_incorrect = Your scratch code is incorrect.
|
twofa_scratch_token_incorrect = Your scratch code is incorrect.
|
||||||
login_userpass = Sign In
|
login_userpass = Sign In
|
||||||
login_openid = OpenID
|
login_openid = OpenID
|
||||||
|
oauth_signup_tab = Register New Account
|
||||||
|
oauth_signup_title = Add Email and Password (for Account Recovery)
|
||||||
|
oauth_signup_submit = Complete Account
|
||||||
|
oauth_signin_tab = Link to Existing Account
|
||||||
|
oauth_signin_title = Sign In to Authorize Linked Account
|
||||||
|
oauth_signin_submit = Link Account
|
||||||
openid_connect_submit = Connect
|
openid_connect_submit = Connect
|
||||||
openid_connect_title = Connect to an existing account
|
openid_connect_title = Connect to an existing account
|
||||||
openid_connect_desc = The chosen OpenID URI is unknown. Associate it with a new account here.
|
openid_connect_desc = The chosen OpenID URI is unknown. Associate it with a new account here.
|
||||||
|
|
|
@ -660,16 +660,18 @@ func LinkAccount(ctx *context.Context) {
|
||||||
ctx.Data["user_name"] = uname
|
ctx.Data["user_name"] = uname
|
||||||
ctx.Data["email"] = email
|
ctx.Data["email"] = email
|
||||||
|
|
||||||
if "" != uname {
|
if len(email) != 0 {
|
||||||
u, _ := models.GetUserByName(uname)
|
// ignoring the "user not found" error
|
||||||
if u != nil {
|
|
||||||
ctx.Data["user_name_exists"] = "true"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if "" != email {
|
|
||||||
u, _ := models.GetUserByEmail(email)
|
u, _ := models.GetUserByEmail(email)
|
||||||
if u != nil {
|
if u != nil {
|
||||||
ctx.Data["email_exists"] = "true"
|
ctx.Data["user_exists"] = true
|
||||||
|
}
|
||||||
|
} else if len(uname) != 0 {
|
||||||
|
// ignoring the "user not found" error
|
||||||
|
u, _ := models.GetUserByName(uname)
|
||||||
|
fmt.Println("Error retrieving username:", err)
|
||||||
|
if u != nil {
|
||||||
|
ctx.Data["user_exists"] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,21 @@
|
||||||
|
|
||||||
<div class="ui tabular menu">
|
<div class="ui tabular menu">
|
||||||
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
|
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
|
||||||
<div class="item {{if not (or .user_name_exists .email_exists)}}active{{end}}"
|
<div class="item {{if not .user_exists}}active{{end}}"
|
||||||
data-tab="auth-link-signup-tab">
|
data-tab="auth-link-signup-tab">
|
||||||
{{.i18n.Tr "auth_link_signup_tab"}}
|
{{.i18n.Tr "auth.oauth_signup_tab"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item {{if or .user_name_exists .email_exists}}active{{end}}"
|
<div class="item {{if .user_exists}}active{{end}}"
|
||||||
data-tab="auth-link-signin-tab">
|
data-tab="auth-link-signin-tab">
|
||||||
{{.i18n.Tr "auth_link_signin_tab"}}
|
{{.i18n.Tr "auth.oauth_signin_tab"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui tab {{if not (or .user_name_exists .email_exists)}}active{{end}}"
|
<div class="ui tab {{if not .user_exists}}active{{end}}"
|
||||||
data-tab="auth-link-signup-tab">
|
data-tab="auth-link-signup-tab">
|
||||||
{{template "user/auth/signup_inner" .}}
|
{{template "user/auth/signup_inner" .}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui tab {{if or .user_name_exists .email_exists}}active{{end}}"
|
<div class="ui tab {{if .user_exists}}active{{end}}"
|
||||||
data-tab="auth-link-signin-tab">
|
data-tab="auth-link-signin-tab">
|
||||||
<div class="ui user signin container icon">
|
<div class="ui user signin container icon">
|
||||||
{{template "user/auth/signin_inner" .}}
|
{{template "user/auth/signin_inner" .}}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
<h4 class="ui top attached header center">
|
<h4 class="ui top attached header center">
|
||||||
{{if .LinkAccountMode}}
|
{{if .LinkAccountMode}}
|
||||||
{{.i18n.Tr "auth_link_signin_title"}}
|
{{.i18n.Tr "auth.oauth_signin_title"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{.i18n.Tr "auth.login_userpass"}}
|
{{.i18n.Tr "auth.login_userpass"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<label></label>
|
<label></label>
|
||||||
<button class="ui green button">
|
<button class="ui green button">
|
||||||
{{if .LinkAccountMode}}
|
{{if .LinkAccountMode}}
|
||||||
{{.i18n.Tr "auth_link_signin_submit"}}
|
{{.i18n.Tr "auth.oauth_signin_submit"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{.i18n.Tr "sign_in"}}
|
{{.i18n.Tr "sign_in"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{{.CsrfTokenHtml}}
|
{{.CsrfTokenHtml}}
|
||||||
<h3 class="ui top attached header">
|
<h3 class="ui top attached header">
|
||||||
{{if .LinkAccountMode}}
|
{{if .LinkAccountMode}}
|
||||||
{{.i18n.Tr "auth_link_signup_title"}}
|
{{.i18n.Tr "auth.oauth_signup_title"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{.i18n.Tr "sign_up"}}
|
{{.i18n.Tr "sign_up"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<label></label>
|
<label></label>
|
||||||
<button class="ui green button">
|
<button class="ui green button">
|
||||||
{{if .LinkAccountMode}}
|
{{if .LinkAccountMode}}
|
||||||
{{.i18n.Tr "auth_link_signup_submit"}}
|
{{.i18n.Tr "auth.oauth_signup_submit"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{.i18n.Tr "auth.create_new_account"}}
|
{{.i18n.Tr "auth.create_new_account"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue