This repository has been created with the intent to provide a simple example of how to use Remix Auth TOTP. This example uses Prisma ORM and SQLite to store and handle the authentication flow.
- Clone the repository and install its dependencies:
npm install
- Run Prisma migrations:
npx prisma migrate dev --name init
- Get required
.env
variables:
In order to successfully implement remix-auth-totp
you will require the following .env
variables:
ENCRYPTION_SECRET=""
RESEND_API_KEY=""
Let's break down how to obtain these variables:
For ENCRYPTION_SECRET
a random 64-character hexadecimal string is required. An example of a random 64-character hexadecimal string is 928F416BAFC49B969E62052F00450B6E974B03E86DC6984D1FA787B7EA533227
.
- You can use a site like https://www.grc.com/passwords.htm to generate a strong secret.
For RESEND_API_KEY
you can visit Resend and create a free account in order to get your API key here.
Note
Remember to replace the current .env.example
file with your own .env
file.
- Run the server:
npm run dev
And you're ready to go! 🎉
If you want to share your own example, feel free to open a PR into the main repository.