-
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
Allow password reset with token alone #1295
Allow password reset with token alone #1295
Conversation
f726795
to
18c1c77
Compare
@jkeen Awesome! Do you know why the specs are failing? |
Looks like after rebasing onto master some of the changes to |
Now I don't know why the specs are failing. |
fe63b54
to
d232301
Compare
Finally figured out the intermittent test failure! So tests pass now @MaicolBen |
Awesome! It'd be great to fix Code Climate but not mandatory, I need to release a version before merging this |
…en is invalid, small refactors for clarity
…re: require_client_password_reset_token to resolve test failures
c337593
to
c93de06
Compare
@@ -184,5 +194,23 @@ def validate_redirect_url_param | |||
return render_create_error_missing_redirect_url unless @redirect_url | |||
return render_error_not_allowed_redirect_url if blacklisted_redirect_url? | |||
end | |||
|
|||
def build_callback_url(reset_password_token) |
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.
can't you use DeviseTokenAuth::Url.generate
for this?
test/test_helper.rb
Outdated
setup { DatabaseCleaner.start } | ||
teardown { DatabaseCleaner.clean } | ||
|
||
|
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.
you can remove these unless it has a purpose
test/test_helper.rb
Outdated
@@ -39,9 +39,12 @@ class ActiveSupport::TestCase | |||
strategies = { active_record: :transaction, | |||
mongoid: :truncation } | |||
DatabaseCleaner.strategy = strategies[DEVISE_TOKEN_AUTH_ORM] | |||
DatabaseCleaner.clean_with(:truncation) |
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.
why this change?
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.
It was an attempt to combat the mysterious database constraint violations with duplicate emails while testing.
That validation problem I don't think is related to the changes on this branch, but I'm still trying to resolve it. I just made a change to ensure unique emails, so hopefully that fixes it
… Add tests that hit this codepath
…tion errors (it seems to work without this now)
@MaicolBen updated! |
@jkeen Thank you! |
@jkeen thank you! |
This is an attempt to resurrect the stagnant PR #1072 💀, which allowed for a reset password flow without needing the user to visit the API directly.
This PR took the existing work of #1072, rebased master on it, fixed a couple of bugs, and updated some tests.