8112c12092
* 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
14 lines
279 B
TypeScript
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");
|
|
}
|
|
}
|