A replacement for Devise confirmable
to use a pin rather than an emailed link to confirm a users email. (Inspired by Slack)
Add this line to your application's Gemfile:
gem 'pinfirmable'
And then execute:
$ bundle
Add the pinfirmable
module to your devise model (e.g User)
class User < ApplicationRecord
devise :database_authenticatable,
:registerable,
...
:pinfirmable
rake db:migrate
# If your devise model isn't called user
rake db:migrate MODEL=admin
Add the javascript include to the asset pipeline.
//= require pinfirmable
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
Check out the project and then run
rake db:setup
To create and migrate a development and test database.
Run rspec
to run the tests.
- Encrypt the pin in the DB
The gem is available as open source under the terms of the MIT License.