Authentication
The only authentication documentation page you need if you just want to setup the dashboard application.
In this page, we will see :
- how to setup your database for authentication
- how to setup
apps/dashboard
for authentication
This feature is implemented with the @kit/auth
package and the Supabase Auth features.
For now, only the apps/dashboard
application implement the authentication feature.
If you want to setup the authentication in another application, you must implement all the code that consume the @kit/auth
package in apps/dashboard
.
Password
Go to you supabase/config.toml
file.
To enable the email provider, make sure that the auth.email section matches the following code.
[auth.email]
# Allow/disallow new user signups via email to your project.
enable_signup = true
# If enabled, a user will be required to confirm any email change on both the old, and new email
# addresses. If disabled, only the new email is required to confirm.
double_confirm_changes = true
# If enabled, users need to confirm their email address before signing in.
enable_confirmations = true
Set your apps/dashboard/config/auth.config.ts
file to fit use the password provider.
import { parseAuthConfig } from '@kit/auth/config'; import { envs } from '~/envs'; export const authConfig = parseAuthConfig({ // NB: This is a public key, so it's safe to expose. // Copy the value from the Supabase Dashboard. captchaSiteKey: envs().NEXT_PUBLIC_CAPTCHA_SITE_KEY, // whether to display the terms checkbox during sign-up displayTermsCheckbox: true, // NB: Enable the providers below in the Supabase Console // in your production project providers: { password: true, }, });
Authentication emails
The password provider requires emails to work. As Supabase will send a Confirm signup email to the user.
Supabase auth emails in development environment
Local dev uses an "in bucket" port for showing what would be sent in email.
Go to http://localhost:54324/ to see the emails sent by Supabase.
oAuth providers
Go to you supabase/config.toml
file.
Add an external OAuth provider for the development environment. You can find all the supported oAuth providers in the here.
For the example, we will add the Google provider.
[auth.external.google]
enabled = true
client_id = "env(SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET)"
redirect_uri = "env(SUPABASE_AUTH_EXTERNAL_REDIRECT_URI)"
Go to the Google Developer Console and create a new OAuth client ID.
Allow to access the following fields :
.../auth/userinfo.email
.../auth/userinfo.profile
Create a new api key for web application to get the client id and secret.
Set the environement variables in the database .env
file at supabase/.env
.
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID="your-google-client-id"
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET="your-google-secret"
SUPABASE_AUTH_EXTERNAL_REDIRECT_URI="your-google-redirect-uri"
Set your apps/dashboard/config/auth.config.ts
file to fit use the new oAuth provider.
import { parseAuthConfig } from '@kit/auth/config'; import { envs } from '~/envs'; export const authConfig = parseAuthConfig({ // NB: This is a public key, so it's safe to expose. // Copy the value from the Supabase Dashboard. captchaSiteKey: envs().NEXT_PUBLIC_CAPTCHA_SITE_KEY, // whether to display the terms checkbox during sign-up displayTermsCheckbox: true, // NB: Enable the providers below in the Supabase Console // in your production project providers: { password: true, oAuth: ['google'], }, });
Environment variables
# ============================================
# AUTHENTICATION
# ============================================
# To adapt for your oAuth provider
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID="your-google-client-id"
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET="your-google-secret"
SUPABASE_AUTH_EXTERNAL_REDIRECT_URI="your-google-redirect-uri"
Database management for the creatorem saas kit.
How to implement the authentication feature in an existing application.
How is this guide?
Last updated on 10/17/2025