MCPcopy Index your code
hub / github.com/simstudioai/sim / isEmailAllowed

Function isEmailAllowed

apps/sim/lib/core/security/deployment.ts:116–133  ·  view source on GitHub ↗
(email: string, allowedEmails: string[])

Source from the content-addressed store, hash-verified

114 * sides, so callers don't need to normalize before calling.
115 */
116export function isEmailAllowed(email: string, allowedEmails: string[]): boolean {
117 const normalizedEmail = email.trim().toLowerCase()
118 const normalizedAllowed = allowedEmails.map((allowed) => allowed.trim().toLowerCase())
119
120 if (normalizedAllowed.includes(normalizedEmail)) {
121 return true
122 }
123
124 const atIndex = normalizedEmail.indexOf('@')
125 if (atIndex > 0) {
126 const domain = normalizedEmail.substring(atIndex + 1)
127 if (domain && normalizedAllowed.some((allowed) => allowed === `@${domain}`)) {
128 return true
129 }
130 }
131
132 return false
133}

Callers 7

deployment.test.tsFile · 0.90
validateDeploymentAuthFunction · 0.90
renderAuthGateFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected