summary refs log tree commit diff
path: root/src/util/passwordStrength.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-24 20:47:06 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-24 20:47:06 +0200
commit8f87546aeb5c14539601ab25c0e07630a5e5043a (patch)
treec9d5ca2d0c307096d5a4e44768c66b4d8cf05ec4 /src/util/passwordStrength.ts
parentMerge pull request #147 from DiegoMagdaleno/master (diff)
downloadserver-8f87546aeb5c14539601ab25c0e07630a5e5043a.tar.xz
:sparkles: use new config
Diffstat (limited to 'src/util/passwordStrength.ts')
-rw-r--r--src/util/passwordStrength.ts15
1 files changed, 2 insertions, 13 deletions
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; }