diff options
Diffstat (limited to 'src/api/routes/users/@me/mfa/codes.ts')
-rw-r--r-- | src/api/routes/users/@me/mfa/codes.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index 4224a1c0..e43f6859 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -1,7 +1,15 @@ import { Router, Request, Response } from "express"; import { route } from "@fosscord/api"; import { BackupCode, Config, FieldErrors, generateMfaBackupCodes, MfaCodesSchema, User } from "@fosscord/util"; -import bcrypt from "bcrypt"; +import { Request, Response, Router } from "express"; + +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."); +} const router = Router(); |