Files
nicktrn 8112c12092 Improve email whitelisting and extend to GitHub auth (#2090)
* make github auth respect email whitelist

* display github login errors

* fix smtp secure env vars

* prevent sending magic link if email not allowed

* fix MARQS_DISABLE_REBALANCING and RUN_ENGINE_DEBUG_WORKER_NOTIFICATIONS
2025-05-22 10:30:00 +01:00

14 lines
279 B
TypeScript

import { env } from "~/env.server";
export function assertEmailAllowed(email: string) {
if (!env.WHITELISTED_EMAILS) {
return;
}
const regexp = new RegExp(env.WHITELISTED_EMAILS);
if (!regexp.test(email)) {
throw new Error("This email is unauthorized");
}
}