I currently have an app that uses regular Devise authentication for logging in and out, but uses Devise’s token_authenticatable module to create a unique token that is used when submitting data to the app from a bookmarklet. Each user gets a unique bookmarklet with their authenticity token baked right into the javascript. However, the way Devise is currently set up, the user has no auth token by default. They have to go to the /edit/users page, press “Generate Token” and then they have one in the db.
I need a way to tell Devise to automatically generate an auth token for each user at sign up.
I’m a newbie, and I’m not sure where to find the Devise controllers to edit this, and even if I could find them, I’m not entirely sure what I would do. Any help is welcome! Thanks.
You can use the helper
ensure_authentication_tokenofDevise::Models::TokenAuthenticatablemodule.
So you
Userclass might be like this: