Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: improved domain handling and early return in signupApiHandler (#5744)

Marc Klingenf047e21e13cb
diff --git a/web/src/features/auth-credentials/server/signupApiHandler.ts b/web/src/features/auth-credentials/server/signupApiHandler.ts
index 62bf85e0da..a15d3bfe36 100644
--- a/web/src/features/auth-credentials/server/signupApiHandler.ts
+++ b/web/src/features/auth-credentials/server/signupApiHandler.ts
@@ -42,7 +42,9 @@ export async function signupApiHandler(
// check if email domain is blocked from email/password sign up via env
const blockedDomains =
- env.AUTH_DOMAINS_WITH_SSO_ENFORCEMENT?.split(",") ?? [];
+ env.AUTH_DOMAINS_WITH_SSO_ENFORCEMENT?.split(",")
+ .map((domain) => domain.trim().toLowerCase())
+ .filter(Boolean) ?? [];
const domain = body.email.split("@")[1]?.toLowerCase();
if (domain && blockedDomains.includes(domain)) {
res.status(422).json({
@@ -58,6 +60,7 @@ export async function signupApiHandler(
res.status(422).json({
message: "You must sign in via SSO for this domain.",
});
+ return;
}
// create the user