summary refs log tree commit diff
path: root/src/api/routes/auth/register.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
commit314a4787ce55a091cb89ef4281d7ba09e8323fa4 (patch)
treed77142c009e9c6d45390a8fe01c9aee966d7a4cc /src/api/routes/auth/register.ts
parentMerge remote-tracking branch 'upstream/staging' into feat/captchaVerify (diff)
parentcase insensitive header for rate limits, fix rate limit default settings (diff)
downloadserver-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.ts9
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();