1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

registration disabled notice

This commit is contained in:
Flam3rboy 2021-10-01 20:11:05 +02:00
parent f4aca24876
commit 966fec2953

View File

@ -50,6 +50,15 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
const { register, security } = Config.get(); const { register, security } = Config.get();
const ip = getIpAdress(req); const ip = getIpAdress(req);
if (register.disabled) {
throw FieldErrors({
email: {
code: "DISABLED",
message: "registration is disabled on this instance"
}
});
}
if (register.blockProxies) { if (register.blockProxies) {
if (isProxy(await IPAnalysis(ip))) { if (isProxy(await IPAnalysis(ip))) {
console.log(`proxy ${ip} blocked from registration`); console.log(`proxy ${ip} blocked from registration`);