0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fixed Chrome remembering wrong username when signing up from invitation

closes https://github.com/TryGhost/Ghost/issues/9868
- place email field directly above password field
- enable email field and do not set an initial value requiring user to type-in/auto-fill the email for Chrome to recognise it
This commit is contained in:
Kevin Ansfield 2019-02-11 11:35:27 +00:00
parent 50b38cb8ff
commit 7f1c71c831
2 changed files with 23 additions and 21 deletions

View file

@ -46,7 +46,10 @@ export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
tokenText = atob(params.token); tokenText = atob(params.token);
email = tokenText.split('|')[1]; email = tokenText.split('|')[1];
signupDetails.set('email', email); // leave e-mail blank even though we get it from the token because
// we need the user to type it in for Chrome to remember the
// email/password combo properly
signupDetails.set('email', '');
signupDetails.set('token', params.token); signupDetails.set('token', params.token);
signupDetails.set('errors', Errors.create()); signupDetails.set('errors', Errors.create());

View file

@ -9,26 +9,6 @@
<form id="signup" class="gh-flow-create" method="post" novalidate="novalidate" onsubmit={{action "submit"}}> <form id="signup" class="gh-flow-create" method="post" novalidate="novalidate" onsubmit={{action "submit"}}>
{{gh-profile-image email=signupDetails.email setImage=(action "setImage")}} {{gh-profile-image email=signupDetails.email setImage=(action "setImage")}}
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="email"}}
<label for="email">Email address</label>
<span class="gh-input-icon gh-icon-mail">
{{svg-jar "email"}}
{{gh-text-input
tabindex="2"
type="text"
id="username"
name="username"
placeholder="Eg. john@example.com"
autocorrect="off"
autocomplete="username email"
disabled="disabled"
value=(readonly signupDetails.email)
input=(action (mut signupDetails.email) value="target.value")
data-test-input="email"
}}
</span>
{{/gh-form-group}}
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="name"}} {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="name"}}
<label for="name">Full name</label> <label for="name">Full name</label>
<span class="gh-input-icon gh-icon-user"> <span class="gh-input-icon gh-icon-user">
@ -50,6 +30,25 @@
{{gh-error-message errors=signupDetails.errors property="name"}} {{gh-error-message errors=signupDetails.errors property="name"}}
{{/gh-form-group}} {{/gh-form-group}}
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="email"}}
<label for="email">Email address</label>
<span class="gh-input-icon gh-icon-mail">
{{svg-jar "email"}}
{{gh-text-input
tabindex="2"
type="text"
id="username"
name="username"
placeholder="Eg. john@example.com"
autocorrect="off"
autocomplete="username email"
value=(readonly signupDetails.email)
input=(action (mut signupDetails.email) value="target.value")
data-test-input="email"
}}
</span>
{{/gh-form-group}}
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="password"}} {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="password"}}
<label for="password">Password</label> <label for="password">Password</label>
<span class="gh-input-icon gh-icon-lock"> <span class="gh-input-icon gh-icon-lock">