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:
parent
f4aca24876
commit
966fec2953
@ -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`);
|
||||||
|
Loading…
Reference in New Issue
Block a user