I want to use devise’ token_authenticatable helper to authenticate users against the system.
I found some older documentations where a method named valid_authentication_token?(…) is used but couldn’t find the same in newer devise version.
So what’s the right way to authenticate a user?
Should I request the Model for user with named token and checking if email-adresses match?
Thanks a lot for your help.
PascalTurbo
If you add
to you user ActionRecord, and add
to your User model
and specify which param is your token key in config/initializer/devise, something like this:
then controllers that use
to authenticate. after the authenticate_user!, individual methods can test using
will authorize users either by the login session or the devise authorization token that is passed on the query string or passed using HTTP basic authentication. See Devise helper code for details.