From 7f1c71c831ad3f2f25ac70bb024eebd4a0057bbe Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 11 Feb 2019 11:35:27 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20Chrome=20remembering=20w?= =?UTF-8?q?rong=20username=20when=20signing=20up=20from=20invitation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ghost/admin/app/routes/signup.js | 5 +++- ghost/admin/app/templates/signup.hbs | 39 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ghost/admin/app/routes/signup.js b/ghost/admin/app/routes/signup.js index 709e231643..f6332e4278 100644 --- a/ghost/admin/app/routes/signup.js +++ b/ghost/admin/app/routes/signup.js @@ -46,7 +46,10 @@ export default Route.extend(styleBody, UnauthenticatedRouteMixin, { tokenText = atob(params.token); 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('errors', Errors.create()); diff --git a/ghost/admin/app/templates/signup.hbs b/ghost/admin/app/templates/signup.hbs index 440ac4a250..6af0923400 100644 --- a/ghost/admin/app/templates/signup.hbs +++ b/ghost/admin/app/templates/signup.hbs @@ -9,26 +9,6 @@
{{gh-profile-image email=signupDetails.email setImage=(action "setImage")}} - {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="email"}} - - - {{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" - }} - - {{/gh-form-group}} - {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="name"}} @@ -50,6 +30,25 @@ {{gh-error-message errors=signupDetails.errors property="name"}} {{/gh-form-group}} + {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="email"}} + + + {{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" + }} + + {{/gh-form-group}} + {{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="password"}}