summary refs log tree commit diff
path: root/src/util/passwordStrength.ts
diff options
context:
space:
mode:
authorPaul Munteanu <luth@luthcode.net>2021-05-28 03:39:33 +0300
committerPaul Munteanu <luth@luthcode.net>2021-05-28 03:39:33 +0300
commitc6ab039787346f0930881ad7a5893e4ea555f852 (patch)
treea115223aa7a3d95c65e3c3432dd3df49e32b9d85 /src/util/passwordStrength.ts
parentMerge branch 'fosscord:master' into master (diff)
parent:construction: permissions (diff)
downloadserver-c6ab039787346f0930881ad7a5893e4ea555f852.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-api
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 f6cec9da..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 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.get().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; }