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

Password edit page available when user is signed in. #3359

Closed
EnotPoloskun opened this issue Dec 8, 2014 · 2 comments
Closed

Password edit page available when user is signed in. #3359

EnotPoloskun opened this issue Dec 8, 2014 · 2 comments

Comments

@EnotPoloskun
Copy link

Ruby version: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
Rails version: Rails 3.2.21
Devise version: 3.4.1

Steps to reproduce.

  1. Sign up
  2. Log out
  3. Send reset password instructions for user
  4. Sign in
  5. Open reset password instructions and copy reset link(You can see email at rails logs)
  6. Add any invalid format to url (http://localhost:3000/users/password/edit?reset_password_token=r9ossoUefCFD3sNUGPxW -> http://localhost:3000/users/password/edit.123?reset_password_token=r9ossoUefCFD3sNUGPxW)
  7. Open page

When there is no any invalid format, require_no_authentication method redirects to a after_sign_in_path(resource), but if any invalid format is manually added, require_no_authentication returns nil. But for sign_in page, if any invalid format is added, server responds with "406 Not Acceptable" and page is not displayed.

Here is github repo with sample app: https://github.com/EnotPoloskun/devise-bug

@josevalim
Copy link
Contributor

The logic is that if the user was just able to sign in, should they still be able to reset their password?

@EnotPoloskun
Copy link
Author

The logic is that user can access reset password page when he is logged in by adding invalid format to the url(described above). If there is no any invalid format, user is redirected with flash "you are already signed in"

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

No branches or pull requests

3 participants