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

Do not return an error on email not found #38

Closed
vincentchalamon opened this issue Mar 26, 2018 · 2 comments
Closed

Do not return an error on email not found #38

vincentchalamon opened this issue Mar 26, 2018 · 2 comments
Assignees
Labels

Comments

@vincentchalamon
Copy link
Contributor

Scenario: I can't reset my password with an invalid email address
    When I reset my password using invalid email address
    Then the request should be invalid with message 'User with field "email" equal to "foo@example.com" cannot be found.'

This scenario is a security leak cause it allows any user to check which email is stored in the database. If email address is invalid, the following message should be visible: if the email address exists, an email has been sent to it..

Same for following scenario:

Scenario: I can't reset my password if I already request a token
    Given I have a valid token
    When I reset my password
    Then the request should be invalid with message 'An unexpired token already exists for this user.'

Response should be 200 & message should be the same.

@vincentchalamon
Copy link
Contributor Author

@gorghoa What do you think about this issue?

@gorghoa
Copy link
Contributor

gorghoa commented Mar 26, 2018

Totally agree :)

Note that the second scenario should no longer happen when I’ll PR this one ;) #37

Also, on token successfully sent, the message displayed should be exactly the same as when an error occured.

Always return a 204 success response ? (letting the message be the responsibility of the UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants