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

Authentication works, but not with every methods #141

Closed
agonist opened this issue Nov 29, 2014 · 1 comment
Closed

Authentication works, but not with every methods #141

agonist opened this issue Nov 29, 2014 · 1 comment

Comments

@agonist
Copy link

agonist commented Nov 29, 2014

Hi, I try to configure token authentication correctly, I followed all the step,

I have my User model with acts_as_token_authenticatable

added acts_as_token_authentication_handler_for User to the controller I want to secure

In my database my user have a authentication_token and email field, the token is generated with no problems.
I have a route get /users/:id, when I call it with a wrong token or email it redirect me cause I provide wrong infos.
But with another route post /users/edit on the same controller, I get the following error :

Can't verify CSRF token authenticity
Completed 422 Unprocessable Entity in 1ms
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):

What I missed ? cause the token and email are still the same.

Thank you

@gonzalo-bulnes
Copy link
Owner

Hello @agonist,

You can find the answer to you question in the FAQ, see #37.

Best regards!

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

2 participants