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:
@@ -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());
|
||||
}
|
||||
Reference in New Issue
Block a user