This repository is a demo application for integrating tru.ID's SubscriberCheck, and Vonage's Verify Api as a multi-factor authentication step creating a password-reset flow within a web application.
Note: This is the
starter-files
branch for the tutorial. For the completed code please checkoutmain
.
- A tru.ID account.
- Create a tru.ID project.
- A Vonage account.
- A mobile phone with a SIM card that has an active mobile data connection.
Clone the starter-files
branch via:
git clone -b starter-files --single-branch https://github.com/tru-ID/web-based-password-reset-tutorial.git
If you're only interested in the finished code in main
then run:
git clone -b main https://github.com/tru-ID/web-based-password-reset-tutorial.git
Copy the .env.example
file to .env
and populate the values with your valid credentials:
cp .env.example .env
This tutorial uses a sqlite3 database, with Sequelize, a modern Node.js ORM to manage the queries.
If you do not wish to use sqlite3, you will need to update the src/config/config.json
database credentials and values.
To install the database,create your users
table and populate it with two existing users run the following migration command:
npx sequelize db:migrate
npx sequelize-cli db:seed:all
First initialize the ngrok tunnel by running the following command:
npx ngrok http 3000
In a new Terminal, run the web server, with the following command:
npm start
In your browser open http://localhost:3000
. To test these users log in as:
[email protected]
(password =password
)[email protected]
(password =password
)- or
[email protected]
(password =password
)
Distributed under the MIT license. See LICENSE
for more information.