Pinfirmable
A replacement for Devise confirmable to use a pin rather than an emailed link to confirm a users email. (Inspired by Slack)
Installation
Add this line to your application's Gemfile:
gem 'pinfirmable'And then execute:
$ bundleAdd the pinfirmable module to your devise model (e.g User)
class User < ApplicationRecord
devise :database_authenticatable,
:registerable,
...
:pinfirmablerake db:migrate
# If your devise model isn't called user
rake db:migrate MODEL=adminAdd the javascript include to the asset pipeline.
//= require pinfirmable
Skip Emails
To skip the pinfirmable email when creating a user (e.g. when seeding a database) the skip_pinfirmation! method is available
user = User.new
# setup the user
user.skip_pinfirmation!
user.save
Development set up
Check out the project and then run
rake db:setupTo create and migrate a development and test database.
Run rspec to run the tests.
Todo
- Encrypt the pin in the DB
License
The gem is available as open source under the terms of the MIT License.