Supabase invite emails send a magic link including token_hash
and type
.
-
Ensure the confirm route is configured in Supabase Auth → URL Configuration:
- Site URL:
https://<your-domain>
- Redirect URLs: include
/auth/confirm
- Site URL:
-
In the email template (Invite user), set the action URL to point to
/auth/confirm
withnext
to a local set-password page, e.g.:${SITE_URL}/auth/confirm?token_hash={{ .TokenHash }}&type={{ .Type }}&next=/auth/set-password
-
Our
/auth/confirm
handler verifies the token and redirects tonext
if valid. -
The
/auth/set-password
page lets the user set their password via a server action callingsupabase.auth.updateUser({ password })
.
This is a template for creating applications using Next.js 14 (app directory) and HeroUI (v2).
You can use one of them npm
, yarn
, pnpm
, bun
, Example using npm
:
npm install
npm run dev
supabase start --ignore-health-check
Add the output to your environment variables:
NEXT_PUBLIC_SUPABASE_URL=<your-supabase-url>
DATABASE_URL=<your-database-url>
JWT_SECRET=<your-jwt-secret>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key>
NEXT_PUBLIC_SUPABASE_ROLE_KEY=<your-role-key>
npx tsx seed.ts
npx supabase db reset --linked
You can generate VAPID keys using the following command:
npm install -g web-push
web-push generate-vapid-keys
Add them to your environment variables:
NEXT_PUBLIC_VAPID_PUBLIC_KEY=<your-public-key>
VAPID_PRIVATE_KEY=<your-private-key>
VAPID_SUBJECT=<your-subject>
Licensed under the MIT license.