A demo using Auth0 passwordless authentication with NextJS
- TypeScript 95.1%
- CSS 2.8%
- JavaScript 1.1%
- Shell 1%
|
|
||
|---|---|---|
| .husky | ||
| .vscode | ||
| app | ||
| components | ||
| contexts | ||
| hooks | ||
| prisma | ||
| public | ||
| utils | ||
| .env.example | ||
| .eslintrc copy.json | ||
| .eslintrc.json | ||
| .gitignore | ||
| .prettierrc | ||
| .yarnrc.yml | ||
| commitlint.config.ts | ||
| docker-compose.yml | ||
| LICENSE | ||
| middleware.ts | ||
| next.config.mjs | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vercel.json | ||
| yarn.lock | ||
Auth0 demo
Commands
Install dependencies
yarn
Run Postgres on Docker
docker-compose up
Run Prisma migrations
yarn prisma:migrate
Generate Prisma client
yarn prisma:generate
Reset Prisma database
yarn db:reset
Auth0 Webhook
Auth0 Flow to register new users
const axios = require('axios');
exports.onExecutePostUserRegistration = async (event) => {
await axios.post(event.secrets.WEBHOOK_URL, { email: event.user.email }, {
headers: {
'Authorization': `Bearer ${event.secrets.AUTH0_API_SECRET_KEY}`,
'Content-Type': 'application/json'
}
});
};
Add the following secrets to your Flow:
WEBHOOK_URL: The URL of your webhook.AUTH0_API_SECRET_KEY: The Auth0 API secret key.