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
    • Navigate to APIs & Services ->Credentials and then Create Credentials.
    • Under Web Application, add your local url,http://localhost:5173 and your SUPABASE PROJECT URL to authorized JavaScript origins.
    • Include your local and https://your-project.supabase.co/auth/v1/callback and then click on Create.
    • Copy the Client ID and Client Secret and paste them in Supabase->Authentication->Providers->Google.
    • Click on Publish App and then follow the steps. You should be able to login from localhost for testing.