I just created a sample application with devise plugin installed. I have :token_authenticatable
in my user model but for some reason when I create a user it creates it with authentication_token
column as NULL
.
It looks like you need to set u.ensure_authentication_token!
when creating a new user to generate a token.
Am I missing something or I need to override devise's code?
In your user class, just add
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable #...etc
before_save :ensure_authentication_token
end
that's a devise method that will set your authentication_token.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With