David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said over 7 years ago on Rails API - Authentication with JWT :

It should be user_signed_in?, not user_signed_in.


David Kimura PRO said over 7 years ago on Rails API - Authentication with JWT :

What error are you receiving? 


David Kimura PRO said over 7 years ago on Rails API - Authentication with JWT :

If I remember correctly, the authenticate_user has some weird interactions with JWT. This was part of the reason for the alias methods in the User model. Part of the solution was to undefine the method current_user and and with the includes of the Knock Authenticatable, the current user would be set.

Are you receiving any specific error messages?


David Kimura PRO said over 7 years ago on Rails API - Authentication with JWT :

That does appear to be a devise error message. If I had to guess, your controller/action that is redirecting/responding you to that error message is not inheriting from the Api::ApplicationController. 


David Kimura PRO said over 7 years ago on Rails API - Authentication with JWT :

You might need to add 

skip_before_action :authenticate_user!

in the controller that is causing the error message. It may be in the user_token_controller.rb where you would need to add this.