Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riccardosenica/nextjs-auth0
A demo using Auth0 passwordless authentication with NextJS
https://github.com/riccardosenica/nextjs-auth0
auth0 authentication nextjs passwordless typescript
Last synced: 4 months ago
JSON representation
A demo using Auth0 passwordless authentication with NextJS
- Host: GitHub
- URL: https://github.com/riccardosenica/nextjs-auth0
- Owner: RiccardoSenica
- License: mit
- Created: 2024-06-20T21:42:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-08T10:16:25.000Z (7 months ago)
- Last Synced: 2024-10-15T17:32:36.926Z (4 months ago)
- Topics: auth0, authentication, nextjs, passwordless, typescript
- Language: TypeScript
- Homepage:
- Size: 283 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Auth0 demo
## Commands
Install dependencies
```bash
yarn
```Run Postgres on Docker
```bash
docker-compose up
```Run Prisma migrations
```bash
yarn prisma:migrate
```Generate Prisma client
```bash
yarn prisma:generate
```Reset Prisma database
```bash
yarn db:reset
```## Auth0 Webhook
Auth0 Flow to register new users
```bash
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.