DEV Community

Discussion on: Devise and JWT in Rails

Collapse
 
tiqu_80 profile image
tiQu

Hey Daniel, this is great--thanks for posting this resource!

One quick q about your full code at the bottom: in SessionsController.rb and RegistrationsController.rb, "generate_jwt" should be called from the "user" object, not "current_user", correct?

I've been using the one you had earlier in your article and that works for me:
token = user.generate_jwt

Let me know if I misread something--I'm still new to Ruby / Rails. Thanks again!

Collapse
 
dhintz89 profile image
Daniel Hintz

Hi tiQu. You are correct, great catch! I've fixed it in the article now. Thanks for calling it out.