Skip to content

Prevent Verify by mail flow redirect bug#1508

Merged
gemfarmer merged 1 commit intomasterfrom
bsh-verify-mail
Jun 30, 2017
Merged

Prevent Verify by mail flow redirect bug#1508
gemfarmer merged 1 commit intomasterfrom
bsh-verify-mail

Conversation

@gemfarmer
Copy link
Contributor

For issue: https://github.com/18F/identity-private/issues/1890

The situation

As @andrewhughey had stated in https://github.com/18F/identity-private/issues/1890#issuecomment-307799695, here is the flow that this PR is fixing:

create account (email, password, 2FA)
verify identity (person info, financial info)
choose to confirm address by mail
send letter
see profile / flash message that letter was sent
sign out
sign in
asked for code from letter but oh no! I never got a letter
choose send new letter

expected: send new letter screen

actual: restart identity verification


The solution

This PR adds logic to prevent the user from being redirected back to identity verification, sending them to the "Send another letter" confirmation screen instead, as expected.

The faulty redirect was happening because the a request to send more mail was triggering the IdvSession service, which redirects to verification if verification hasn't been completed. To fix this, we added an exception that prevents that redirect if a user has mail already sent mail.

@gemfarmer gemfarmer changed the title Prevent verify by mail flow redirect bug Prevent Verify by mail flow redirect bug Jun 27, 2017
@gemfarmer gemfarmer requested review from hursey013 and jmhooper June 27, 2017 20:09
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this line. It doesn't seem to be used anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about putting all these steps between lines 207 and 218 into a well-named method (the method can live in this file), such as perform_id_verification_with_usps_without_confirming_code_then_sign_out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely.

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh oops! Good catch

Copy link
Contributor

Choose a reason for hiding this comment

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

In a follow-up PR, we should replace all instances of this check with the new one we created here. I just remembered that we're not actually sending the letter anywhere. Before you added the ability to limit the amount of letters a user can send, this session key was the only way to determine if the USPS method had been chosen. However, now that we keep track of when letters are sent in the DB, we can use that instead. Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely!

Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

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

LGTM. Please squash your commits into one, and please write your commit message following our style guide: https://github.com/18F/identity-idp/blob/master/CONTRIBUTING.md#commit-message-style-guide

**Why**
The situation

As @andrewhughey had stated in 18F/identity-private#1890 (comment), here is the flow that this PR is fixing:

create account (email, password, 2FA)
verify identity (person info, financial info)
choose to confirm address by mail
send letter
see profile / flash message that letter was sent
sign out
sign in
asked for code from letter but oh no! I never got a letter
choose send new letter

expected: send new letter screen

actual: restart identity verification

**How**

This PR adds logic to prevent the user from being redirected back to identity verification, sending them to the "Send another letter" confirmation screen instead, as expected.

The faulty redirect was happening because the a request to send more mail was triggering the IdvSession service, which redirects to verification if verification hasn't been completed. To fix this, we added an exception that prevents that redirect if a user has mail already sent mail.

For issue: 18F/identity-private#1890
@gemfarmer gemfarmer merged commit 81885e9 into master Jun 30, 2017
@gemfarmer gemfarmer deleted the bsh-verify-mail branch June 30, 2017 15:22
@jmhooper
Copy link
Contributor

Should we create a feature spec for sending another letter? I didn't see one in idv/flow_spec or saml/loa3_sso_spec which is where I'd think to look for them.

@jmhooper
Copy link
Contributor

Ah found it right where I though it should be. My bad, wasn't looking hard enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants