Authentication Setup

Configure Supabase Auth with Google, GitHub, and Magic Links.

Authentication Setup

PacBoiler uses Supabase Auth for secure user management. This guide covers setting up Google OAuth, GitHub OAuth, and Magic Links.

1. Create Supabase Project

  1. Go to database.new and create a new project.
  2. Once created, go to Project Settings > API.
  3. Copy the Project URL and anon public key.
  4. Paste them into your .env.local file:
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key

2. Configure Auth Providers

Go to Authentication > Providers in your Supabase dashboard.

Email / Magic Link

  1. Enable Email provider.
  2. Ensure Enable Email Confirmations is ON (recommended for production) or OFF (for faster dev).

Google OAuth

  1. Go to the Google Cloud Console.
  2. Create a new project.
  3. Configure the OAuth Consent Screen (External).
  4. Go to Credentials and create an OAuth Client ID (Web Application).
  5. Add the following Authorized Redirect URI: https://<your-project-ref>.supabase.co/auth/v1/callback
  6. Copy the Client ID and Client Secret.
  7. Paste them into the Supabase Google Provider settings.

GitHub OAuth

  1. Go to GitHub Developer Settings.
  2. Create a New OAuth App.
  3. Set the Authorization callback URL to: https://<your-project-ref>.supabase.co/auth/v1/callback
  4. Copy the Client ID and generate a Client Secret.
  5. Paste them into the Supabase GitHub Provider settings.

3. URL Configuration

For authentication to work correctly locally and in production, you need to configure the redirect URLs in Supabase.

  1. Go to Authentication > URL Configuration.
  2. Set Site URL to your production URL (e.g., https://myapp.com).
  3. Add http://localhost:3000/** to Redirect URLs.

Next Steps

Now that Auth is configured, let's set up the Database tables.

Step 2: Database Setup