diff --git a/src/_staart/rest/auth.ts b/src/_staart/rest/auth.ts index 3d1ec6b91..ddea0f00f 100644 --- a/src/_staart/rest/auth.ts +++ b/src/_staart/rest/auth.ts @@ -145,6 +145,11 @@ export const register = async ( ) => { if (!config("newUserRegistrations")) throw new Error("User registrations are not enabled"); + if (config("newUserRegistrationDomains")) { + const domains = config("newUserRegistrationDomains"); + if (!domains.includes(email?.split("@")[1] ?? "")) + throw new Error("This domain is not allowed"); + } if (email) { const isNewEmail = (await prisma.emails.findMany({ where: { email, isVerified: true } }))