diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 00:44:13 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 00:44:13 +1000 |
commit | 314a4787ce55a091cb89ef4281d7ba09e8323fa4 (patch) | |
tree | d77142c009e9c6d45390a8fe01c9aee966d7a4cc /src/api/routes/auth/register.ts | |
parent | Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify (diff) | |
parent | case insensitive header for rate limits, fix rate limit default settings (diff) | |
download | server-314a4787ce55a091cb89ef4281d7ba09e8323fa4.tar.xz |
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to 'src/api/routes/auth/register.ts')
-rw-r--r-- | src/api/routes/auth/register.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index 8059e3f1..d3b5a59c 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -1,7 +1,14 @@ import { Request, Response, Router } from "express"; import { Config, generateToken, Invite, FieldErrors, User, adjustEmail, RegisterSchema } from "@fosscord/util"; import { route, getIpAdress, IPAnalysis, isProxy, verifyCaptcha } from "@fosscord/api"; -import bcrypt from "bcrypt"; + +let bcrypt: any; +try { + bcrypt = require("bcrypt"); +} catch { + bcrypt = require("bcryptjs"); + console.log("Warning: using bcryptjs because bcrypt is not installed! Performance will be affected."); +} import { HTTPError } from "@fosscord/util"; const router: Router = Router(); |