Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

fix(email-first): Ensure "Mistyped email" links work as expected. #6067

Merged
merged 1 commit into from
Apr 16, 2018

Conversation

shane-tomlinson
Copy link

If a relier specified an email for the email-first flow, users
that clicked on "Mistyped email" saw no visible change in the
screen.

In reality, there was a subtle change, the user was redirected
to /, but the redirected back to /signin or /signup.

This happened because on the 2nd render, the index page saw
that the relier model contained an email address and redirected
back to where the user just was.

To get around this, before checking the email and redirecting,
clear the email from the relier model. The email is saved
into the formPrefill model since the email elements on
the next page have a name attribute, and that will
be used to prefill the email when the user comes back.

fixes #6033

@mozilla/fxa-devs - r?

assert.isTrue(view.checkEmail.calledWith('testuser@testuser.com'));
assert.isTrue(view.checkEmail.calledOnceWith('testuser@testuser.com'));
assert.isFalse(relier.has('email'));
assert.equal(view.formPrefill.get('email'), 'testuser@testuser.com');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding an assertion for model.get('relierEmail'), or do we consider that an implementation detail that's covered by functional/other tests?

Copy link
Contributor

@philbooth philbooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

If a relier specified an email for the email-first flow, users
that clicked on "Mistyped email" saw no visible change in the
screen.

In reality, there was a subtle change, the user was redirected
to `/`, but the redirected back to `/signin` or `/signup`.

This happened because on the 2nd render, the index page saw
that the relier model contained an email address and redirected
back to where the user just was.

To get around this, before checking the email and redirecting,
clear the email from the relier model. The email is saved
into the formPrefill model and that will be used to
prefill the email when the user comes back.

A small change to the router was needed to. In the "email-first"
flow, ensure the user can go back.

fixes #6033
@shane-tomlinson shane-tomlinson force-pushed the issue-6033-mistyped-email-with-query-param branch from 3f54012 to 412b246 Compare April 16, 2018 09:30
@ghost ghost assigned shane-tomlinson Apr 16, 2018
@shane-tomlinson shane-tomlinson merged commit 8a9a772 into master Apr 16, 2018
@shane-tomlinson shane-tomlinson deleted the issue-6033-mistyped-email-with-query-param branch April 16, 2018 09:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Mistyped email" does nothing in email-first flow if email query parameter is specified.
2 participants