summary refs log tree commit diff
path: root/api/src/routes/auth
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-04 10:47:04 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-04 10:47:04 +0200
commitb69f5baeb997cecd12a0e42b94fe0616058866a2 (patch)
treea63c89ba5bb52249f2ab858c703bab0dc82b5e84 /api/src/routes/auth
parent:sparkles: custom user flags offset (diff)
parentMerge pull request #412 from TheArcaneBrony/master (diff)
downloadserver-ts-b69f5baeb997cecd12a0e42b94fe0616058866a2.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-server
Diffstat (limited to 'api/src/routes/auth')
-rw-r--r--api/src/routes/auth/register.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts

index 9c058399..1344c994 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts
@@ -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`); @@ -202,6 +211,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re disabled: false, deleted: false, email: email, + rights: "0", nsfw_allowed: true, // TODO: depending on age public_flags: "0", flags: "0", // TODO: generate