Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions docs/AUTH-SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Complete guide for configuring Supabase authentication with email/password and O

## Prerequisites

- Supabase project created: `vswxgxbjodpgwfgsjrhq`
- Supabase project created — substitute its ref for `<YOUR-PROJECT-REF>` in the URLs below
- Environment variables configured in `.env.local`

## Part 1: Database Setup
Expand All @@ -13,7 +13,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Supabase SQL Editor

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/sql
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/sql

**Step 2:** Drop all existing tables (clean slate)

Expand All @@ -33,7 +33,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 4:** Verify tables were created

- Navigate to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/editor
- Navigate to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/editor
- You should see these tables:
- `payment_intents` ← Payment system
- `payment_results` ← Payment system
Expand All @@ -51,7 +51,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Auth Providers

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/providers
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/providers

**Step 2:** Find "Email" in the provider list

Expand All @@ -76,7 +76,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Email Templates

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/templates
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/templates

**Step 2:** Customize templates

Expand Down Expand Up @@ -104,7 +104,7 @@ Complete guide for configuring Supabase authentication with email/password and O
| **Application name** | `ScriptHammer` (or your preferred name) |
| **Homepage URL** | `http://localhost:3000` (development) or your production URL |
| **Application description** | (Optional) "Next.js template with authentication" |
| **Authorization callback URL** | `https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1/callback` |
| **Authorization callback URL** | `https://<YOUR-PROJECT-REF>.supabase.co/auth/v1/callback` |

**Step 3:** Register application

Expand All @@ -121,7 +121,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Auth Providers

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/providers
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/providers

**Step 2:** Find and enable GitHub

Expand All @@ -141,7 +141,7 @@ Complete guide for configuring Supabase authentication with email/password and O
**Step 5:** Verify callback URL matches

- Ensure the callback URL in Supabase matches what you entered in GitHub:
- `https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1/callback`
- `https://<YOUR-PROJECT-REF>.supabase.co/auth/v1/callback`

## Part 4: Enable Google OAuth (Optional)

Expand Down Expand Up @@ -173,7 +173,7 @@ Complete guide for configuring Supabase authentication with email/password and O
- **Application type:** Web application
- **Name:** ScriptHammer
- **Authorized redirect URIs:** Click **"+ ADD URI"**
- Add: `https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1/callback`
- Add: `https://<YOUR-PROJECT-REF>.supabase.co/auth/v1/callback`
- Click **"CREATE"**

**Step 5:** Copy credentials
Expand All @@ -185,7 +185,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Auth Providers

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/providers
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/providers

**Step 2:** Find and enable Google

Expand All @@ -208,7 +208,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Auth settings

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/url-configuration
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/url-configuration

**Step 2:** Set Site URL

Expand All @@ -225,7 +225,7 @@ Complete guide for configuring Supabase authentication with email/password and O

**Step 1:** Navigate to Auth settings

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/settings/auth
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/settings/auth

**Step 2:** Configure security settings

Expand Down Expand Up @@ -269,7 +269,7 @@ docker compose exec scripthammer pnpm run dev

**Step 5:** Verify user was created

- Navigate to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/users
- Navigate to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/users
- You should see `test@example.com` in the user list

### 6.2 Test OAuth Sign-In (GitHub/Google)
Expand All @@ -294,7 +294,7 @@ docker compose exec scripthammer pnpm run dev

**Step 5:** Check Supabase users

- Navigate to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/users
- Navigate to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/users
- You should see your GitHub/Google account in the user list

## Part 7: Environment Variables
Expand All @@ -305,17 +305,17 @@ Create or update `.env.local` in project root:

```bash
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://vswxgxbjodpgwfgsjrhq.supabase.co
NEXT_PUBLIC_SUPABASE_URL=https://<YOUR-PROJECT-REF>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here

# Get anon key from: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/settings/api
# Get anon key from: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/settings/api
```

### 7.2 Get Supabase API Keys

**Step 1:** Navigate to API settings

- **URL:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/settings/api
- **URL:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/settings/api

**Step 2:** Copy API keys

Expand All @@ -336,15 +336,15 @@ docker compose exec scripthammer pnpm run dev

**Solution:** Email/GitHub/Google provider not enabled in Supabase

- Go to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/providers
- Go to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/providers
- Enable the provider you're trying to use
- Click **"Save"**

### Issue: "Invalid redirect URL"

**Solution:** Redirect URL not whitelisted

- Go to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/url-configuration
- Go to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/url-configuration
- Add your URL to **"Redirect URLs"**
- Format: `http://localhost:3000/**` (note the `/**` wildcard)

Expand All @@ -354,15 +354,15 @@ docker compose exec scripthammer pnpm run dev

- Check email inbox for verification link
- Or disable email confirmation temporarily:
- Go to: https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/settings/auth
- Go to: https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/settings/auth
- Toggle **"Enable email confirmations"** to OFF (not recommended for production)

### Issue: GitHub OAuth callback error

**Solution:** Callback URL mismatch

- Verify GitHub OAuth app callback URL matches:
- `https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1/callback`
- `https://<YOUR-PROJECT-REF>.supabase.co/auth/v1/callback`
- Check both GitHub app settings and Supabase provider settings

### Issue: Google OAuth "redirect_uri_mismatch"
Expand All @@ -372,18 +372,18 @@ docker compose exec scripthammer pnpm run dev
- Go to: https://console.cloud.google.com/apis/credentials
- Edit your OAuth 2.0 Client ID
- Add authorized redirect URI:
- `https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1/callback`
- `https://<YOUR-PROJECT-REF>.supabase.co/auth/v1/callback`

## Reference Links

### Supabase Dashboard

- **Project Home:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq
- **SQL Editor:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/sql
- **Auth Providers:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/providers
- **Auth Users:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/users
- **API Settings:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/settings/api
- **URL Configuration:** https://supabase.com/dashboard/project/vswxgxbjodpgwfgsjrhq/auth/url-configuration
- **Project Home:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>
- **SQL Editor:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/sql
- **Auth Providers:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/providers
- **Auth Users:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/users
- **API Settings:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/settings/api
- **URL Configuration:** https://supabase.com/dashboard/project/<YOUR-PROJECT-REF>/auth/url-configuration

### OAuth Provider Setup

Expand Down
2 changes: 1 addition & 1 deletion docs/features/payment-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This guide walks you through setting up the complete payment integration system
**Get the Project ID:**

7. In the left Settings sidebar, click **General**
8. Copy **Project ID** (alphanumeric code like `vswxgxbjodpgwfgsjrhq`)
8. Copy **Project ID** (alphanumeric code like `abcdefghijklmnopqrst`)

**Database Password:**

Expand Down
2 changes: 1 addition & 1 deletion docs/specs/016-user-authentication/contracts/auth-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
description: API contracts for authentication endpoints (Supabase Auth)

servers:
- url: https://vswxgxbjodpgwfgsjrhq.supabase.co/auth/v1
- url: https://<YOUR-PROJECT-REF>.supabase.co/auth/v1
description: Supabase Auth Server

paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
description: API contracts for user profile management

servers:
- url: https://vswxgxbjodpgwfgsjrhq.supabase.co/rest/v1
- url: https://<YOUR-PROJECT-REF>.supabase.co/rest/v1
description: Supabase REST API

paths:
Expand Down
2 changes: 1 addition & 1 deletion docs/specs/016-user-authentication/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
cp .env.example .env

# Add Supabase credentials
NEXT_PUBLIC_SUPABASE_URL=https://vswxgxbjodpgwfgsjrhq.supabase.co
NEXT_PUBLIC_SUPABASE_URL=https://<YOUR-PROJECT-REF>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key>
```

Expand Down