This repository was archived by the owner on Feb 8, 2026. It is now read-only.
Open
Conversation
The overridden methods in UserPasswordsController were inadvertently missing out on Devise's "paranoid mode", which protects against user enumeration attacks. Current dependency is Devise ~> 3.4.1 according to the gemspec, which calls a separate method to determine redirect location. All existing specs still pass. Added a spec for nonexistent users. The situation with existing users requires a good deal more setup since it would trigger the e-mail.
kushniryb
suggested changes
Jun 22, 2018
Contributor
kushniryb
left a comment
There was a problem hiding this comment.
Please rebase against master & fix comments
| expect(flash[:notice]).to eq I18n.t(:send_paranoid_instructions, scope: [:devise, :user_passwords, :spree_user]) | ||
| end | ||
| end | ||
|
|
Contributor
There was a problem hiding this comment.
Please remove empty line
| end | ||
|
|
||
| end | ||
|
|
Contributor
There was a problem hiding this comment.
Please remove empty line
|
|
||
| context 'with paranoid mode' do | ||
| before { Devise.paranoid = true } | ||
| after { Devise.paranoid = false } |
Contributor
There was a problem hiding this comment.
Add empty line after after
|
|
||
| context 'when resetting password' do | ||
| it 'puts an error on the object' do | ||
| spree_post :create, spree_user: {email: 'made-up-email@made-up-domain.com'} |
Contributor
There was a problem hiding this comment.
Add empty line after spree_post & add space after hash key and hash value
| before { Devise.paranoid = true } | ||
| after { Devise.paranoid = false } | ||
| it 'does not indicate whether the user exists' do | ||
| spree_post :create, spree_user: {email: 'made-up-email@made-up-domain.com'} |
Contributor
There was a problem hiding this comment.
Add empty line & fix hash formatting
| it 'does not indicate whether the user exists' do | ||
| spree_post :create, spree_user: {email: 'made-up-email@made-up-domain.com'} | ||
| expect(response).to redirect_to spree.login_path | ||
| expect(flash[:notice]).to eq I18n.t(:send_paranoid_instructions, scope: [:devise, :user_passwords, :spree_user]) |
Contributor
There was a problem hiding this comment.
Please use %i[] instead of [:a, :b]
| spree_post :create, spree_user: {email: 'made-up-email@made-up-domain.com'} | ||
| expect(response).to be_success | ||
| expect(assigns(:spree_user).kind_of?(Spree::User)).to eq true | ||
| expect(assigns(:spree_user).errors.messages[:email].first).to eq I18n.t(:not_found, scope: [:errors, :messages]) |
Contributor
There was a problem hiding this comment.
Please use %i[] instead of [:a, :b]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The overridden methods in UserPasswordsController were inadvertently
missing out on Devise's "paranoid mode", which protects against user
enumeration attacks.
Current dependency is Devise ~> 3.4.1 according to the gemspec, which
calls a separate method to determine redirect location.
All existing specs still pass. Added a spec for nonexistent users. The
situation with existing users requires a good deal more setup since it
would trigger the e-mail.