Skip to content

Simple Rails engine which has two devise models and provides json api for registration, signin, password reset, mailers etc

License

Notifications You must be signed in to change notification settings

sakozz/multimodel_devise

Repository files navigation

MultimodelDevise

Rails engine that implements devise multi-model and provides basic authentication and authorization via API. Ths engine is useful when

  1. You have two different user models. i.e. Admin user and end-users
  2. You want to authenticate user via API with authentication token.

This engine implements basic token authentication and authorization.

Installation

####Option 1. You can clone the engine to your project and start to make modifications if needed

1 Go to folder where you want to clone

cd my_project/vendor

2 Clone the engine

git clone git@github.com:sunil-shrestha/multimodel_devise.git

3 Reference the engine as gem inside your gemfile

gem 'multimodel_devise', path: './vendor/multimodel_devise'

####Option 2. Use it as gem from github

Add this line to your application's Gemfile:

gem 'multimodel_devise', git: 'https://github.com/sunil-shrestha/multimodel_devise'

And then execute:

$ bundle

Usage

Copy migrations from multimodel_devise to application

rake multimodel_devise:install:migrations

Create default admin user

rake multimodel_devise:create_admin

Configurations

By default, token is regenerated for every new signin/session and expires in 8 weeks. Update the following configs as per need.

MultimodelDevise::Engine.config.token_expires_in = 8.weeks
MultimodelDevise::Engine.config.regenerate_token_every_session = true 

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

About

Simple Rails engine which has two devise models and provides json api for registration, signin, password reset, mailers etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published