Skip to content

expired confirmation & reset link #164

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

Closed
m2omou opened this issue Feb 26, 2015 · 6 comments
Closed

expired confirmation & reset link #164

m2omou opened this issue Feb 26, 2015 · 6 comments

Comments

@m2omou
Copy link

m2omou commented Feb 26, 2015

When I create a new user, or ask to reset my password, a confirmation or reset url is sent by email.

Everything works perfectly. But when reclicking to that same link I got a "Routing Error Not Found".

I want to be able to say to the user, after reclicking that the link is now expired for example.

http://localhost:3000/auth/confirmation?config=default&confirmation_token=a4-MgzesYWTwqAyfXx6C&redirect_url=http%3A%2F%2Flocalhost%3A3000%2F

I have the same issue with confirmation and reset password link.

I'm using the 0.1.29 version.

Thanks for your help !

@lynndylanhurley
Copy link
Owner

@m2omou - would you be ok with an error that reads "Invalid or expired confirmation token"?

@m2omou
Copy link
Author

m2omou commented Feb 26, 2015

Yes that would be great ! :)

I'm also using ng-token-auth gem.

Will it be possible to catch the "Invalid or expired confirmation token" using the following event ?

$scope.$on('auth:registration-email-error', function(ev, reason) {
    alert("Registration failed: " + reason.errors[0]);
});

@lynndylanhurley
Copy link
Owner

@m2omou - try this event instead.

@cmolina
Copy link

cmolina commented Jul 20, 2015

What can I do to avoid the "Routing Error Not Found" error in rails?
I'd like to just redirect to the main page if the user clicks a link in his/her email again.

@tmlee
Copy link

tmlee commented Jun 5, 2016

@camolin3 You may override the controller with your custom setup

For instance,

controllers/devise/passwords_controller.rb

class Devise::PasswordsController < DeviseTokenAuth::PasswordsController

  def render_edit_error
    raise "Do something else other than Routing Error Not Found"
  end

end

config/routes.rb

mount_devise_token_auth_for 'User', at: 'auth', controllers: { passwords: 'devise/passwords' }

In config/routes.rb set the custom controller to point to passwords. You can see why this works here https://github.com/lynndylanhurley/devise_token_auth/blob/master/lib/devise_token_auth/rails/routes.rb

@zachfeldman
Copy link
Contributor

Hi there @m2omou ,

In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!

If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.

Hope all is well.

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

No branches or pull requests

5 participants