Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 5x 5x 5x 5x 5x 5x 5x 5x 5x 1x 1x 5x 5x 5x 1x 1x 1x 8x 8x | /**
* Admin email management via ADMIN_EMAILS environment variable.
*
* Comma-separated list of emails that should be auto-promoted to admin role.
* Checked during sign-in (jwt callback) and by the shared role resolver.
*/
let cachedEmails: string[] | null = null
function getAdminEmails(): string[] {
if (cachedEmails !== null) return cachedEmails
const raw = process.env.ADMIN_EMAILS ?? ''
cachedEmails = raw
.split(',')
.map((e) => e.trim().toLowerCase())
.filter(Boolean)
return cachedEmails
}
export function isAdminEmail(email: string | null | undefined): boolean {
if (!email) return false
return getAdminEmails().includes(email.toLowerCase())
}
/** Clear cached emails (for testing) */
export function _clearCache(): void {
cachedEmails = null
}
|