-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
User#send_reset_password_instructions redirect_url not set as default if blank #1253
base: master
Are you sure you want to change the base?
User#send_reset_password_instructions redirect_url not set as default if blank #1253
Conversation
@@ -330,8 +330,7 @@ class DeviseTokenAuth::PasswordsControllerTest < ActionController::TestCase | |||
DeviseTokenAuth.default_password_reset_url = @redirect_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redirect_url
isn't null, why this change in the spec ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was to test "Using default_password_reset_url", however previously the redirect url was passed as a param, and that's why the spec passed, and thus the change in the spec to show that the test is still valid without the url being passed to the controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and how the spec in line 61 passes? we have a validation for the missing redirect url in the controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mengqing ☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaicolBen My bad, it looks like on
DeviseTokenAuth.default_password_reset_url |
DeviseTokenAuth.default_password_reset_url
is already used as a backup for @redirect_url
, hence the spec in line 61 passes.
The issue I wanted to fix in this PR is really for resource.send_reset_password_instructions
where the method would still work if no redirect_url is passed as an option, eg: calling it directly. Since there isn't a test to cover send_reset_password_instructions
, do I need to create a new test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can, add a spec for this case in the model
… be set to default url if not present in opts
552a753
to
2ada9f3
Compare
redirect_url
should be set toDeviseTokenAuth.default_password_reset_url
if not present in the options