From 8f87546aeb5c14539601ab25c0e07630a5e5043a Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 24 May 2021 20:47:06 +0200 Subject: :sparkles: use new config --- src/util/passwordStrength.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/util/passwordStrength.ts') diff --git a/src/util/passwordStrength.ts b/src/util/passwordStrength.ts index 7196f797..cc503843 100644 --- a/src/util/passwordStrength.ts +++ b/src/util/passwordStrength.ts @@ -1,5 +1,5 @@ +import { Config } from "@fosscord/server-util"; import "missing-native-js-functions"; -import * as Config from "./Config"; const reNUMBER = /[0-9]/g; const reUPPERCASELETTER = /[A-Z]/g; @@ -17,13 +17,7 @@ const blocklist: string[] = []; // TODO: update ones passwordblocklist is stored * Returns: 0 > pw > 1 */ export function check(password: string): number { - const { - minLength, - minNumbers, - minUpperCase, - minSymbols, - blockInsecureCommonPasswords, - } = Config.apiConfig.getAll().register.password; + const { minLength, minNumbers, minUpperCase, minSymbols } = Config.get().register.password; var strength = 0; // checks for total password len @@ -51,10 +45,5 @@ export function check(password: string): number { strength = 0; } - if (blockInsecureCommonPasswords) { - if (blocklist.includes(password)) { - strength = 0; - } - } return strength; } -- cgit 1.5.1