IMPORTANT: This is very alpha-release. Stable release (0.1) is coming.
Ability to additional authentication by SMS code or IP for Devise gem.
Migration:
rails generate devise_login_smsable <YOUR_DEVISE_MODEL>
Config initializer:
rails generate devise_login_smsable:config
Look into config/initializers/devise_login_smsable.rb and change the phone_column_name if needed, then run migrations:
rake db:migrate
Routes: Add this line to config/routes.rb inside routes block:
login_smsable
Model:
Add new module to devise declaration in your model (named as :login_smsable), so your model should look like:
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :login_smsable
Look into this two files to build same gates using other services:
- lib/devise_login_smsable/abstract_gate.rb
- lib/devise_login_smsable/smsru.rb
More info and instructions will come.
- Rails::Engine not loads config/routes.rb
- Add possibility to resend sms_code (now user should log-out and log-in again to receive new sms_code when current one is expired)
© Chvertkin Maxim. Protected by MIT-LICENSE.