Skip to content

Commit 4008af7

Browse files
remove: Supabase auth provider (#417)
## Summary - remove Supabase auth provider, callback, OTP, and email/password form flows from dashboard - make Auth.js/Ory the only dashboard auth path and always use bearer + X-Team-ID API headers - remove Supabase env/dependencies/contracts and update docs, tests, and generated OpenAPI contracts
1 parent ebf221d commit 4008af7

104 files changed

Lines changed: 744 additions & 6886 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
### REQUIRED SERVER ENVIRONMENT VARIABLES
33
### =================================
44

5-
### Auth provider: supabase or ory
6-
AUTH_PROVIDER=supabase
7-
8-
### Supabase configuration (required when AUTH_PROVIDER=supabase)
9-
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
10-
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
11-
125
### Dashboard API admin token used for user bootstrap and creator email hydration
136
DASHBOARD_API_ADMIN_TOKEN=your_dashboard_api_admin_token
147

8+
### Auth.js configuration
9+
### Generate with `npx auth secret` or `openssl rand -hex 32`.
10+
AUTH_SECRET=your_auth_secret
11+
12+
### Ory Network configuration
13+
ORY_SDK_URL=https://your-project.projects.oryapis.com
14+
ORY_OAUTH2_CLIENT_ID=your_ory_oauth2_client_id
15+
ORY_OAUTH2_CLIENT_SECRET=your_ory_oauth2_client_secret
16+
### Access-token audience requested from Ory. Must match the backend JWT audience configuration.
17+
ORY_OAUTH2_AUDIENCE=https://api.e2b.dev
18+
### Ory project admin API token used for IdentityApi lookups
19+
ORY_PROJECT_API_TOKEN=your_ory_project_api_token
20+
1521
### Domain for the E2B cluster
1622
# Resolves Infrastructure and Dashboard API + E2B SDK configuration
1723
NEXT_PUBLIC_E2B_DOMAIN=e2b.dev
@@ -26,28 +32,13 @@ NEXT_PUBLIC_E2B_DOMAIN=e2b.dev
2632
### OPTIONAL SERVER ENVIRONMENT VARIABLES
2733
### =================================
2834

29-
### Ory Network configuration (required when AUTH_PROVIDER=ory)
30-
### SDK URL of the Ory Network project (or custom domain like https://auth.e2b.dev)
31-
# ORY_SDK_URL=https://your-project.projects.oryapis.com
32-
### OAuth2 client credentials issued by Ory for this dashboard deployment
33-
# ORY_OAUTH2_CLIENT_ID=
34-
# ORY_OAUTH2_CLIENT_SECRET=
35-
### Access-token audience requested from Ory. Must match infra AUTH_PROVIDER_CONFIG.jwt[].issuer.audiences.
36-
# ORY_OAUTH2_AUDIENCE=https://api.e2b.dev
37-
### Ory project admin API token used for IdentityApi lookups
38-
# ORY_PROJECT_API_TOKEN=
3935
### Self-hosted Ory admin endpoints (alternative to ORY_PROJECT_API_TOKEN).
4036
### Set both when running self-hosted; leave unset to use Ory Network with the PAT above.
4137
# ORY_KRATOS_ADMIN_URL=http://localhost:4434
4238
# ORY_HYDRA_ADMIN_URL=http://localhost:4445
43-
### Auth.js configuration (required when AUTH_PROVIDER=ory)
44-
### Generate with `npx auth secret` or `openssl rand -hex 32`. Used to encrypt the JWT session cookie.
45-
# AUTH_SECRET=
4639
### Set to 1 outside Vercel-hosted production to allow Auth.js to trust the Host header
4740
# AUTH_TRUST_HOST=1
4841

49-
### Legacy Supabase bootstrap fallback used by dashboard route team resolution.
50-
### Ory sign-in bootstrap does not depend on this flag.
5142
# ENABLE_USER_BOOTSTRAP=0
5243

5344
### Billing API URL (Required if NEXT_PUBLIC_INCLUDE_BILLING=1)
@@ -62,9 +53,6 @@ NEXT_PUBLIC_E2B_DOMAIN=e2b.dev
6253
### Development infrastructure API domain
6354
# DEVELOPMENT_INFRA_API_DOMAIN=
6455

65-
### ZeroBounce API key for email validation
66-
# ZEROBOUNCE_API_KEY=
67-
6856
### Optional KV database configuration
6957
### Required only for KV-backed capabilities such as alternate-email warning dedupe.
7058
### Must be Vercel/Upstash Redis REST compatible; raw redis://localhost:6379 is not supported by @vercel/kv.
@@ -118,6 +106,3 @@ NEXT_PUBLIC_E2B_DOMAIN=e2b.dev
118106

119107
### Set to 1 to enable verbose logging
120108
# NEXT_PUBLIC_VERBOSE=0
121-
122-
### Set to 1 to pause sign-ups and sign-ins during auth migration.
123-
# NEXT_PUBLIC_AUTH_MIGRATION_IN_PROGRESS=0

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@ jobs:
4949
KV_REST_API_READ_ONLY_TOKEN: test-read-only-token
5050
KV_REST_API_TOKEN: test-api-token
5151
KV_REST_API_URL: https://test-kv-api.example.com
52-
AUTH_PROVIDER: supabase
52+
AUTH_SECRET: test-auth-secret
53+
ORY_SDK_URL: https://test-ory.projects.oryapis.com
54+
ORY_OAUTH2_CLIENT_ID: test-ory-client-id
55+
ORY_OAUTH2_CLIENT_SECRET: test-ory-client-secret
56+
ORY_OAUTH2_AUDIENCE: https://api.e2b-test.dev
57+
ORY_PROJECT_API_TOKEN: test-ory-project-api-token
5358
DASHBOARD_API_ADMIN_TOKEN: test-dashboard-admin-token
5459
BILLING_API_URL: https://billing.e2b-test.dev
5560
NEXT_PUBLIC_E2B_DOMAIN: e2b-test.dev
5661
NEXT_PUBLIC_POSTHOG_KEY: test-posthog-key
57-
NEXT_PUBLIC_SUPABASE_URL: https://test-supabase-url.supabase.co
58-
NEXT_PUBLIC_SUPABASE_ANON_KEY: test-supabase-anon-key
5962
NEXT_PUBLIC_STRIPE_BILLING_URL: https://test-stripe-billing.example.com
6063
NEXT_PUBLIC_SCAN: 0
6164
NEXT_PUBLIC_MOCK_DATA: 1

README.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Our Dashboard is a modern, feature-rich web application built to manage and moni
1818
## Features
1919
- **Modern Stack**: Built with Next.js 16, React 19, and TypeScript
2020
- **Real-time Analytics**: Monitor your sandbox usage and performance
21-
- **Authentication**: Secure authentication powered by Supabase
21+
- **Authentication**: Secure authentication powered by Auth.js and Ory
2222
- **Type Safety**: Full TypeScript support throughout the codebase
2323

2424
## Getting Started
@@ -29,7 +29,7 @@ Our Dashboard is a modern, feature-rich web application built to manage and moni
2929
- Node.js 20.9+
3030
- Git
3131
- Vercel account
32-
- Supabase account
32+
- Ory project or self-hosted Ory deployment
3333

3434
### Local Development Setup
3535

@@ -56,36 +56,16 @@ cp .env.example .env.local
5656

5757
4. Set up required services:
5858

59-
#### a. Supabase Setup
60-
1. Create a new Supabase project
61-
2. Go to Project Settings > API
62-
3. Copy the `anon key` & `service_role key` to populate `.env.local`
63-
4. Configure authentication:
64-
- Go to Authentication > URL Configuration
65-
- Set Site URL to the hosting domain
66-
- Add `http://localhost:3000/**` to Redirect URLs (for development)
67-
5. Enable auth providers:
68-
- Go to Authentication > Providers
69-
- Enable the providers you want to use (GitHub, Google, E-Mail)
70-
- Configure each provider with the appropriate credentials
71-
6. Configure e-mail templates:
72-
- Navigate to **Authentication → Templates** in the Supabase dashboard
73-
- Update the URLs in the **Reset Password** and **Confirm Sign-Up** templates so that the CTA links point back to the dashboard's confirmation endpoint:
74-
75-
**Reset Password**
76-
```
77-
{{ .SiteURL }}/api/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next={{ .RedirectTo }}&confirmation_url={{ .ConfirmationURL }}
78-
```
79-
80-
**Confirm Sign-Up**
81-
```
82-
{{ .SiteURL }}/api/auth/confirm?token_hash={{ .TokenHash }}&type=email&next={{ .RedirectTo }}&confirmation_url={{ .ConfirmationURL }}
83-
```
59+
#### a. Auth.js / Ory Setup
60+
1. Configure an Ory OAuth2 client for the dashboard callback URL: `/api/auth/oauth/callback/ory`.
61+
2. Populate `.env.local` with the Ory and Auth.js variables from `.env.example`.
62+
3. Enable the upstream identity providers you want in Ory (GitHub, Google, email/password, etc.).
63+
4. Ensure the Ory access-token audience matches the backend JWT audience setting.
8464

8565
#### b. Key-Value Store Setup (Optional)
8666
Redis/KV is optional for standard dashboard deployments, including local, enterprise, and on-prem environments. The dashboard can boot and run core auth and dashboard workflows without KV configured.
8767

88-
KV is currently used for optional capability checks and for deduplicating ZeroBounce alternate-email warnings. If you need those capabilities, configure a Vercel/Upstash Redis REST-compatible store:
68+
KV is currently used for optional health-check coverage. If you need that capability, configure a Vercel/Upstash Redis REST-compatible store:
8969
```
9070
KV_REST_API_URL=your_redis_rest_api_url
9171
KV_REST_API_TOKEN=your_redis_api_write_token

bun.lock

Lines changed: 0 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"generate:infra": "bunx openapi-typescript ./spec/openapi.infra.yaml -o ./src/core/shared/contracts/infra-api.types.ts",
2121
"generate:dashboard-api": "bunx openapi-typescript ./spec/openapi.dashboard-api.yaml -o ./src/core/shared/contracts/dashboard-api.types.ts",
2222
"generate:argus": "bunx openapi-typescript ./spec/openapi.argus.yaml -o ./src/core/shared/contracts/argus-api.types.ts",
23-
"generate:supabase": "bunx supabase@latest gen types typescript --schema public > src/core/shared/contracts/database.types.ts --project-id $SUPABASE_PROJECT_ID",
2423
"<<<<<<< Scripts": "",
2524
"scripts:check-app-env": "bun scripts/check-app-env.ts",
2625
"scripts:check-playwright-env": "bun scripts/check-playwright-env.ts",
@@ -48,8 +47,6 @@
4847
"dependencies": {
4948
"@hookform/resolvers": "^5.2.2",
5049
"@launchdarkly/node-server-sdk": "^9.11.2",
51-
"@marsidev/react-turnstile": "^1.4.1",
52-
"@next-safe-action/adapter-react-hook-form": "^2.0.0",
5350
"@next/env": "^16.2.7",
5451
"@opentelemetry/api": "^1.9.0",
5552
"@opentelemetry/auto-instrumentations-node": "^0.77.0",
@@ -80,8 +77,6 @@
8077
"@shikijs/themes": "3.2.1",
8178
"@stripe/react-stripe-js": "^5.3.0",
8279
"@stripe/stripe-js": "^8.2.0",
83-
"@supabase/ssr": "^0.5.2",
84-
"@supabase/supabase-js": "^2.48.1",
8580
"@tanstack/match-sorter-utils": "^8.19.4",
8681
"@tanstack/react-query": "^5.90.7",
8782
"@tanstack/react-query-devtools": "^5.91.1",

scripts/check-app-env.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,6 @@ const schema = appEnvSchema
2828
path: ['BILLING_API_URL', 'NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY'],
2929
}
3030
)
31-
.refine(
32-
(data) => {
33-
if (data.NEXT_PUBLIC_CAPTCHA_ENABLED === '1') {
34-
return (
35-
!!data.NEXT_PUBLIC_TURNSTILE_SITE_KEY && !!data.TURNSTILE_SECRET_KEY
36-
)
37-
}
38-
39-
return true
40-
},
41-
{
42-
message:
43-
'NEXT_PUBLIC_CAPTCHA_ENABLED is enabled, but NEXT_PUBLIC_TURNSTILE_SITE_KEY or TURNSTILE_SECRET_KEY is missing',
44-
path: ['NEXT_PUBLIC_TURNSTILE_SITE_KEY', 'TURNSTILE_SECRET_KEY'],
45-
}
46-
)
4731
.refine(
4832
(data) => {
4933
if (data.NEXT_PUBLIC_INCLUDE_REPORT_ISSUE === '1') {

0 commit comments

Comments
 (0)