mirror of
https://github.com/spacebarchat/server.git
synced 2024-09-21 10:11:34 +02:00
✨ registration disabled notice
This commit is contained in:
parent
f4aca24876
commit
966fec2953
@ -50,6 +50,15 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
|
||||
const { register, security } = Config.get();
|
||||
const ip = getIpAdress(req);
|
||||
|
||||
if (register.disabled) {
|
||||
throw FieldErrors({
|
||||
email: {
|
||||
code: "DISABLED",
|
||||
message: "registration is disabled on this instance"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (register.blockProxies) {
|
||||
if (isProxy(await IPAnalysis(ip))) {
|
||||
console.log(`proxy ${ip} blocked from registration`);
|
||||
|
Loading…
Reference in New Issue
Block a user