1. Integrate
  2. Auth

Integrate

Auth

Setting Up User Authentication in Supabase

  1. Enable Sign Ups

    In Supabase Dashboard navigate to Settings ->Authentication tab and make sure "Allow new users to sign up" is enabled.

  2. 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.
  3. 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.
  4. 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 and Client Secret and paste them in Supabase->Authentication->Providers->Google.