devise-otp-second-step icon indicating copy to clipboard operation
devise-otp-second-step copied to clipboard

An example of how to implemented OTP two-factor authentication as a second login step in Rails and Devise

Devise OTP 2FA as Second Login Step Example

Tests

This is an example project that demonstrates how to implement OTP two-factor authentication in devise so that the user is asked for their OTP code as a second login step.

OTP as second-step

A step by step guide is available here: Implementing OTP two-factor authentication as a second login step with Rails and Devise

Using this example

You can run this example by following the steps below.

  1. Run yarn

    yarn install
    
  2. Run bundler

    bundle install
    
  3. Setup the database

    rails db:reset
    rails db:migrate db:seed
    
  4. Visit [http://localhost:3000/])(http://localhost:3000/). Default credentials are:

    Username: [email protected]
    Password: letmein