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/confirmwithnextto a local set-password page, e.g.:${SITE_URL}/auth/confirm?token_hash={{ .TokenHash }}&type={{ .Type }}&next=/auth/set-password -
Our
/auth/confirmhandler verifies the token and redirects tonextif valid. -
The
/auth/set-passwordpage 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 installnpm run devsupabase start --ignore-health-checkAdd 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.tsnpx supabase db reset --linkedYou can generate VAPID keys using the following command:
npm install -g web-push
web-push generate-vapid-keysAdd 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.