Knock: Authentication failed when passing the token back

Created on 7 Mar 2017  路  3Comments  路  Source: nsarno/knock

I'm using rails 5 API with a React & React-native clients and axios for api calls on the clients. On both clients I keep getting:

Filter chain halted as :authenticate_user rendered or redirected Completed 401 Unauthorized

The workflow goes as follows: Make a post to /user_token, I'm able to successfully get a JWT token, I then make a get to /users/:id to retrieve their information and thats when I get the 404.

I am passing the exact token that I recieved in the header exaclty like the documentation states.

I have already gone to #146 which did not solve my problem.

Has anyone else encountered this and know of a solution?

Most helpful comment

Same issue as yours.

If you use devise, you should remove the method current_user, ref

include Knock::Authenticable
before_action :authenticate_user
# devise defines this, while knock is using `method_missing`
undef_method :current_user

All 3 comments

Same issue as yours.

If you use devise, you should remove the method current_user, ref

include Knock::Authenticable
before_action :authenticate_user
# devise defines this, while knock is using `method_missing`
undef_method :current_user

@cs0511 HOURS. I spent HOURS on this error, I wanted to cry, thank you for this solution!

Same issue as yours.

If you use devise, you should remove the method current_user, ref

include Knock::Authenticable
before_action :authenticate_user
# devise defines this, while knock is using `method_missing`
undef_method :current_user

Thank You Man !!! You're just awesome

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuuu picture yuuu  路  3Comments

rayway30419 picture rayway30419  路  5Comments

ghost picture ghost  路  6Comments

ghost picture ghost  路  4Comments

FNGR2911 picture FNGR2911  路  7Comments