Integrate
Auth
Setting Up User Authentication in Supabase
Enable Sign Ups
In Supabase Dashboard navigate to Settings ->Authentication tab and make sure "Allow new users to sign up" is enabled.
Setup Auth Redirect URL
- Set your default Redirect URL for auth by navigating to
Authentication ->URL Configuration
. For example, we added the following for local development:http://localhost:5173/auth/callback?*
. - Test that the sign up and forgot password emails link back to your domain correctly by checking the
redirect_to
parameter for your domain.
- Set your default Redirect URL for auth by navigating to
Setup Social Logins
- Decide which social logins you want to support, and set them up in the Supabase Auth console under “Auth Providers”. Be sure to provide them the Supabase callback URL.
- Edit the oauthProviders list in /src/routes/(auth)/auth/socials_conf.ts with the list of providers you chose. Make this an empty array if you dont need any social logins.
- Test each social provider to ensure you setup the client ID, client secret and callback correctly.
Adding Google Oauth
- Go to Google Cloud.In the Oauth consent screen enter your SUPABASE URL in the authorized domains section.
- Navigate to APIs & Services ->Credentials
and then
Create Credentials
. Choose OAuth Client ID. - Choose Web Application, add your local url,http://localhost:5173 to authorized JavaScript origins.
- Add your https://your-project.supabase.co/auth/v1/callback to authorized redirect URIs and then click on
Create
. - Copy the
Client ID
andClient Secret
and paste them in Supabase->Authentication->Providers->Google.