Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7597741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:13:54+00:00 2026-05-30T22:13:54+00:00

I currently have an app that uses regular Devise authentication for logging in and

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:13:55+00:00Added an answer on May 30, 2026 at 10:13 pm

    You can use the helper ensure_authentication_token of Devise::Models::TokenAuthenticatable
    module.

    So you User class might be like this:

    class User < ActiveRecord::Base
      devise :database_authenticatable
    
      before_save :ensure_authentication_token
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have a .NET 2.0 web app that uses forms authentication via cookies.
I currently have a simple app that includes user authentication through devise and a
I have an application written in MVC that uses your regular .Net Forms Authentication.
I currently have an iPhone app in the iTunes app store that uses a
Using PHP.. I have a small app that I built that currently uses a
I have app that uses two threads: one thread for regular application work and
I have an app that currently uses a bunch of include directives of aspx
I have a web app that currently uses the current HttpContext to store a
I currently have a mobile app that uses a socket connection to communicate with
I have an app that uses an sqlite database. Currently I have a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.