MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / emailDomain

Function emailDomain

apps/host-selfhost/src/auth/sso.ts:13–17  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

11// The domain of a well-formed address, or null — so a malformed email can never
12// match an allowlist entry (`emailDomain("@example.com")` is null, not "example.com").
13export const emailDomain = (email: string): string | null => {
14 const at = email.lastIndexOf("@");
15 if (at <= 0 || at === email.length - 1) return null;
16 return email.slice(at + 1).toLowerCase();
17};
18
19// Admission = the IdP vouches for the address (`email_verified`, mapped to
20// `emailVerified` by the genericOAuth callback) AND its domain is allowlisted.

Callers 2

isAdmittedFunction · 0.85
sso.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected