Auto-follow existing server admins when a new user registers

Hop-State: A_06FPE85XGRGM7FD155BAF78
Hop-Proposal: R_06FPE85ATWMCJ2G1HP9SMZR
Hop-Task: T_06FPE7FQ3T1G2VXH0TY9SR0
Hop-Attempt: AT_06FPE7FQ3RRTGK6K7VYESAR
This commit is contained in:
2026-07-15 11:53:46 -07:00
committed by Hop
parent a1841c51a7
commit 0e64b83a99
5 changed files with 194 additions and 23 deletions
+16
View File
@@ -0,0 +1,16 @@
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());
}