Skip to content

Return to branded page consistently when canceling#1511

Merged
monfresh merged 1 commit intomasterfrom
mb-add-view-specs
Jun 28, 2017
Merged

Return to branded page consistently when canceling#1511
monfresh merged 1 commit intomasterfrom
mb-add-view-specs

Conversation

@monfresh
Copy link
Contributor

Why: Consistency is key. In this case, the cancel link on the
forgot password page was always linking to the home page.

How: Don't use the shared/cancel partial because the user will
never be signing up or going through IdV if they are accessing the
Forgot Password page, so we can directly link to the decorated session's
cancel_link_path which contains the logic to determine whether it
should point to the home page or the branded page.

**Why**: Consistency is key. In this case, the cancel link on the
forgot password page was always linking to the home page.

**How**: Don't use the `shared/cancel` partial because the user will
never be signing up or going through IdV if they are accessing the
Forgot Password page, so we can directly link to the decorated session's
`cancel_link_path` which contains the logic to determine whether it
should point to the home page or the branded page.
@hursey013
Copy link
Contributor

I know it's not ideal but would it be possible to add another condition to the partial to catch this scenario so we can continue having all of the cancel links in one place?

@zachmargolis
Copy link
Contributor

Or we could pass in a locals: { link: decorated_session.cancel_link_path } to the partial, right?

@monfresh
Copy link
Contributor Author

The problem is the partial is going through several conditionals that will always return false. I prefer not to go through conditionals if they're never needed. How about we create a separate shared partial for the scenarios where the user is not signed in and is not submitting a token?

@monfresh
Copy link
Contributor Author

I think what needs to happen ideally is to remove the logic from the partial and instead use the pattern we use with the decorated session where we create different partials for different situations and have the decorator classes decide which partial to use.

I'd be happy to work on that in a separate PR. This PR is a quick fix for the cancel link on the forgot password page, and to add the missing view spec.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM, seems reasonable to fix the bug now and refactor later

@monfresh monfresh merged commit da90407 into master Jun 28, 2017
@monfresh monfresh deleted the mb-add-view-specs branch June 28, 2017 19:26
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