The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update check-account-exists.ts
Kiran K5efa2e115d26
diff --git a/apps/web/lib/actions/check-account-exists.ts b/apps/web/lib/actions/check-account-exists.tsindex 7f458d4f21..16bb81931f 100644--- a/apps/web/lib/actions/check-account-exists.ts+++ b/apps/web/lib/actions/check-account-exists.ts@@ -30,13 +30,12 @@ export const checkAccountExistsAction = actionClient}// Check SAML enforcement- const hostname = new URL(process.env.NEXTAUTH_URL as string).hostname;const emailDomain = email.split("@")[1];- const shouldCheckSAML = APP_HOSTNAMES.has(hostname) && !isGenericEmail(emailDomain);+ const hostname = new URL(process.env.NEXTAUTH_URL as string).hostname;+ const shouldCheckSAML =+ APP_HOSTNAMES.has(hostname) && !isGenericEmail(emailDomain);- // Run both queries in parallelconst [user, workspace] = await Promise.all([- // Find the userprisma.user.findUnique({where: {email,@@ -45,7 +44,7 @@ export const checkAccountExistsAction = actionClientpasswordHash: true,},}),- // Check SAML enforcement (only if needed)+shouldCheckSAML? prisma.project.findUnique({where: {@@ -58,17 +57,9 @@ export const checkAccountExistsAction = actionClient: Promise.resolve(null),]);- if (workspace?.ssoEnforcedAt) {- return {- accountExists: !!user,- hasPassword: !!user?.passwordHash,- requireSAML: true,- };- }-return {accountExists: !!user,hasPassword: !!user?.passwordHash,- requireSAML: false,+ requireSAML: !!workspace?.ssoEnforcedAt,};});