You will need to create a user model, define routes, include concerns, and you may want to alter some of the default settings for this gem. Run the following command for an easy one-step installation:
rails g devise_token_auth:install [USER_CLASS] [MOUNT_PATH]
rails g devise_token_auth:install_mongoid [USER_CLASS] [MOUNT_PATH]
rails g devise_token_auth:install User auth
This generator accepts the following optional arguments:
The name of the class to use for user authentication.
The following events will take place when using the install generator:
- A model will be created in the
app/modelsdirectory. If the model already exists, a concern (and fields for
Mongoid) will be included at the file. Read more.
- A concern will be included by your application controller at
app/controllers/application_controller.rb. Read more.
ActiveRecorda migration file will be created in the
db/migratedirectory. Inspect the migrations file, add additional columns if necessary, and then run the migration:rake db:migrate
You may also need to configure the following items: