(email: string)
| 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"). |
| 13 | export 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. |
no outgoing calls
no test coverage detected