Passwordless Login with Nexmo Verify
Ruby CSS HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
views
.env.example
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
app.rb

README.md

Passwordless Login with Nexmo Verify

A Sinatra (Ruby) app showing how to implement passwordless login and registration using the Nexmo Verify API.

Prerequisites

Getting started

# clone this repository
git clone git@github.com:Nexmo/ruby-passwordless-login.git
# change to folder
cd ruby-passwordless-login
# install dependencies
bundle install
# create a .env
cp .env.example .env

Next you will need to sign up for a Nexmo account and get your API credentials from the API dashboard and put them in your .env file.

Finally all that's left is to start the server.

ruby app.rb

Usage

This app shows you how to login a user using Sinatra, Ruby and Nexmo Verify.

Once your server is started:

  • Visit localhost:4567
  • Click Login
  • Fill in your phone number without any leading 0's or +'s (e.g. 445555666777)
  • You will receive a code in seconds, fill this in on the second form and submit
  • You will now be logged in

As this is a very simple starter app this app does not do any user verification against a database. It does show you how to ensure the verification was a success and how to catch any errors that may occur when trying to create or verify a verification request.

License

This project is licensed under the MIT license.