Skip to content

Add otp choice presenter#902

Merged
monfresh merged 1 commit intomasterfrom
add-otp-choice-presenter
Jan 28, 2017
Merged

Add otp choice presenter#902
monfresh merged 1 commit intomasterfrom
add-otp-choice-presenter

Conversation

@el-mapache
Copy link
Contributor

@el-mapache el-mapache commented Dec 27, 2016

Depends on previous two presenter PRs (#885, #901)

Copy link
Contributor

Choose a reason for hiding this comment

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

If we add a unit test for OtpDeliveryPresenter that verifies the actual expected text for header, then checking @presenter.header here is fine. Otherwise, without the unit test, this expectation would pass even if the class modifies the header method to something unexpected.

Copy link
Contributor Author

@el-mapache el-mapache Jan 25, 2017

Choose a reason for hiding this comment

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

Definitely, I'll change this to be consistent with the other header method tests tests. I must have changed/missed this when I was rebasing. Thanks!

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 other than the missing spec for OtpDeliveryPresenter.

@el-mapache el-mapache force-pushed the add-otp-choice-presenter branch from 8b746d5 to 6948c61 Compare January 25, 2017 22:12
@monfresh
Copy link
Contributor

I noticed a bug related to the changes you've been making, but it also happens on the master branch, so I'm not sure when it was introduced:

If you attempt to change your phone after the 60-minute window has passed, such that you need to enter your current password + 2FA, once you are prompted to enter the OTP that was sent to your current phone, if you click the link to "get another text message", it takes you to the Profile page instead of refreshing the page with a new OTP.

@el-mapache
Copy link
Contributor Author

ok, I'll take a look. Just for clarification, the re auth window expires after 60 minutes? not 60 seconds?

@monfresh
Copy link
Contributor

I think this bug existed before any of these changes were merged, so I'll take a look at it, and we can merge this PR when it's ready.

@monfresh
Copy link
Contributor

And yes, I meant 60 seconds.

@monfresh
Copy link
Contributor

I see that you've addressed the @presenter.header issue, but it looks like you amended your previous commit? In the future, could you please create a new commit when addressing PR feedback? It makes it a whole lot easier to see the discrete changes between before PR review and after PR review. Thanks!

@monfresh
Copy link
Contributor

LGTM. Please squash and merge yourself. Thanks!

@el-mapache el-mapache force-pushed the add-otp-choice-presenter branch 2 times, most recently from 9b6b542 to 9aea107 Compare January 26, 2017 21:23
@monfresh
Copy link
Contributor

Still looks good. Please squash, and then I'll merge because Hakiri is acting up.

@el-mapache el-mapache force-pushed the add-otp-choice-presenter branch 2 times, most recently from 702fb8a to fa9bc56 Compare January 27, 2017 01:03
@el-mapache
Copy link
Contributor Author

@monfresh done, thanks!

@el-mapache
Copy link
Contributor Author

Nm got a bit hasty, will fix these tonight. 😬

**Why**: Presenters make the views a little cleaner

Don't show recovery code, unconfirmed phone links

**Why**: The user shouldn't be able to use a recovery code when
confirming a changed phone number, nor should they be able to select the
'use another phone' choice when reauthenticating after choosing a new
phone number

Moves session context + related methods to module

**Why**: Methods were getting duplicated across modules

Adds new method to check for auth context only

**Why**: The `authentication_context?` needs to handle two types of auth
contexts, and we don't want to keep cluttering up multiple files with
hardcoded string references

Adds presenters for phone view

**Why**: To consolidate logic of how we show fallback otp links and
associated help text to the user

Adds authenticator presenter

**Why**: To consolidate logic for displaying otp fallback links and help
text
@el-mapache el-mapache force-pushed the add-otp-choice-presenter branch from fa9bc56 to d65d0fc Compare January 27, 2017 07:19
@monfresh monfresh merged commit 109c53d into master Jan 28, 2017
@monfresh monfresh deleted the add-otp-choice-presenter branch January 28, 2017 01:03
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.

2 participants