lynndylanhurley / lynndylanhurley/devise_token_auth

route not found from link in email password reset

Open
#324 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
3.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I' am trying use the password reset function of devise in a mobile application.
I'm calling http://{{url}}/auth/password, with
email ="my email"
redirect_url = "http://{{url}}/auth/password/edit" (where {url} is my server url)
I receive the email, but when I try the link inside it, I'm getting "Routing Error".

In my logs I have :
Completed 302 Found in 93ms (ActiveRecord: 2.9ms) so the redirection worked

and then
Started GET "/auth/password/edit" for ::1 at 2015-08-03 17:45:37 +0200
Processing by DeviseTokenAuth::PasswordsController#edit as HTML
Completed 404 Not Found in 3ms (ActiveRecord: 0.0ms)

ActionController::RoutingError (Not Found):
devise_token_auth (0.1.31) app/controllers/devise_token_auth/passwords_controller.rb💯in `edit'

If I subclass passwords_controller (in overrides/passwords_controller.rb), copy/paste almost all the code from the original devise passwords controller and add :
mount_devise_token_auth_for 'User', at: 'auth', controllers: {
passwords: 'overrides/passwords'
}
everything works fine.
Am I doing something wrong ? I just want the link to redirect on the classic devise page to reset password

I'm using Rails 4.2.1 and Devise 3.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with devise_token_auth (0.1.31) app/controllers/devise_token_auth/passwords_controller.rb at line 100 and reproduce the GET to /auth/password/edit using the Rails 4.2.1 and Devise 3.3 setup described. Compare it with overrides/passwords_controller.rb and the passwords controller mapping; done means the email link reaches the classic Devise password-reset page without a 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.