Skip to content

Commit 5578c29

Browse files
committed
fix: auth flow
1 parent a100c4a commit 5578c29

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id_here
88
NEXT_PUBLIC_SUPABASE_URL=
99
NEXT_PUBLIC_SUPABASE_ANON_KEY=
1010
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=
11+
SUPABASE_SECRET_KEY=

app/api/auth/check-email/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ type CheckEmailBody = {
77

88
export async function POST(request: NextRequest) {
99
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
10-
const serviceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY;
10+
const serviceRoleKey = process.env.SUPABASE_SECRET_KEY ?? process.env.SUPABASE_SERVICE_ROLE_KEY;
1111

1212
if (!supabaseUrl || !serviceRoleKey) {
13-
return NextResponse.json({ error: "Missing Supabase server configuration." }, { status: 500 });
13+
return NextResponse.json(
14+
{ error: "Missing Supabase server configuration. Set SUPABASE_SECRET_KEY or SUPABASE_SERVICE_ROLE_KEY." },
15+
{ status: 500 }
16+
);
1417
}
1518

1619
let body: CheckEmailBody = {};

0 commit comments

Comments
 (0)