From d21342517335e58bb78ccc14ce8a8b975b963877 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Mon, 10 Nov 2025 22:19:10 +0000 Subject: [PATCH] Remove isNewUser logic since Discord OAuth no longer creates accounts cgen-abe7552d99a545508bbd9334a141279c --- api/discord/oauth/callback.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/discord/oauth/callback.ts b/api/discord/oauth/callback.ts index 430d4e04..c38960cb 100644 --- a/api/discord/oauth/callback.ts +++ b/api/discord/oauth/callback.ts @@ -223,7 +223,6 @@ export default async function handler(req: any, res: any) { .single(); let userId: string; - let isNewUser = false; if (existingLink) { // Discord ID already linked - use existing user @@ -233,7 +232,7 @@ export default async function handler(req: any, res: any) { userId, ); } else { - // Discord not linked yet. Check if we should auto-link. + // Discord not linked yet. Check if email matches existing account. // Check if email exists in user_profiles const { data: existingUserProfile } = await supabase @@ -250,9 +249,9 @@ export default async function handler(req: any, res: any) { ); } else { // Discord email doesn't match any existing account - // Instead of auto-creating, redirect user to sign in with email first + // Don't auto-create - ask user to sign in with email first console.log( - "[Discord OAuth] Discord email not found in existing accounts, asking user to sign in first", + "[Discord OAuth] Discord email not found in existing accounts, redirecting to sign in", { discord_email: discordUser.email, },