0e64b83a99
Hop-State: A_06FPE85XGRGM7FD155BAF78 Hop-Proposal: R_06FPE85ATWMCJ2G1HP9SMZR Hop-Task: T_06FPE7FQ3T1G2VXH0TY9SR0 Hop-Attempt: AT_06FPE7FQ3RRTGK6K7VYESAR
17 lines
481 B
TypeScript
17 lines
481 B
TypeScript
export function configuredAdminEmails(value = process.env.ADMIN_EMAILS): string[] {
|
|
return [...new Set(
|
|
(value || '')
|
|
.split(',')
|
|
.map((email) => email.trim().toLowerCase())
|
|
.filter(Boolean)
|
|
)];
|
|
}
|
|
|
|
export function isConfiguredAdminEmail(
|
|
email: string | null | undefined,
|
|
value = process.env.ADMIN_EMAILS
|
|
): boolean {
|
|
if (!email) return false;
|
|
return configuredAdminEmails(value).includes(email.toLowerCase());
|
|
}
|