From e3f6a29df79865ae9a0d842ba5d59a2851894081 Mon Sep 17 00:00:00 2001 From: Diego Magdaleno Date: Wed, 19 May 2021 20:39:31 -0500 Subject: Config: First rewrite of config and working implementation of getting values --- src/util/passwordStrength.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/util/passwordStrength.ts') diff --git a/src/util/passwordStrength.ts b/src/util/passwordStrength.ts index f6cec9da..71a5b5be 100644 --- a/src/util/passwordStrength.ts +++ b/src/util/passwordStrength.ts @@ -1,5 +1,5 @@ import "missing-native-js-functions"; -import Config from "./Config"; +import * as Config from "./Config"; const reNUMBER = /[0-9]/g; const reUPPERCASELETTER = /[A-Z]/g; @@ -17,13 +17,14 @@ const blocklist: string[] = []; // TODO: update ones passwordblocklist is stored * Returns: 0 > pw > 1 */ export function check(password: string): number { + const passwordProperties = Config.apiConfig.get('register.password', { minLength: 8, minNumbers: 2, minUpperCase: 2, minSymbols: 0, blockInsecureCommonPasswords: false }) as Config.DefaultOptions; const { minLength, minNumbers, minUpperCase, minSymbols, blockInsecureCommonPasswords, - } = Config.get().register.password; + } = passwordProperties.register.password; var strength = 0; // checks for total password len -- cgit 1.5.1