Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate to Login screen after ResetPassword and Signup events #369

Merged
merged 3 commits into from
Jan 16, 2017

Conversation

cocojoe
Copy link
Member

@cocojoe cocojoe commented Jan 11, 2017

Ensure .Login is allowed

@@ -73,6 +73,7 @@ class DatabaseForgotPasswordPresenter: Presentable, Loggable {
} else {
let message = "We've just sent you an email to reset your password".i18n(key: "com.auth0.lock.database.forgot.success.message", comment: "forgot password email sent")
self.messagePresenter?.showSuccess(message)
guard !self.options.allow.contains(.Login) else { return self.navigator.navigate(.root) }
Copy link
Member

Choose a reason for hiding this comment

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

A better use of guard is to remove the unnecessary or uncommon branches of a flow. In this case the odd branch is when login is not allowed so we can either return nothing or do an old-fashioned else since it's more readable for this case because of the double negation.

@hzalaz
Copy link
Member

hzalaz commented Jan 11, 2017

And tests?

Added ForgotPasssord auto navigate test
@cocojoe cocojoe force-pushed the feature_login_screen_after_actions branch from 15bc70e to e4ee112 Compare January 12, 2017 09:58
@hzalaz hzalaz modified the milestone: v2-Next Jan 12, 2017
@hzalaz hzalaz merged commit 5b6dfad into v2 Jan 16, 2017
@hzalaz hzalaz deleted the feature_login_screen_after_actions branch January 16, 2017 16:32
@hzalaz hzalaz modified the milestones: v2-Next, 2.0.0 Feb 16, 2017
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