From 0233600eaa5abb481cbaf5f5a480fd0752ab7d9d Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Fri, 2 Sep 2022 22:55:38 +0200 Subject: [PATCH] Add keywords --- src/app/templates/auth/Auth.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/templates/auth/Auth.jsx b/src/app/templates/auth/Auth.jsx index a1bbb5a4e5..c38fe76a9c 100644 --- a/src/app/templates/auth/Auth.jsx +++ b/src/app/templates/auth/Auth.jsx @@ -36,6 +36,8 @@ const CONFIRM_PASSWORD_ERROR = 'Passwords don\'t match.'; const EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i; const BAD_EMAIL_ERROR = 'Invalid email address'; +const MATRIX_KEYWORDS = ['matrix', 'cinny', 'element', 'synapse', 'dendrite']; + function isValidInput(value, regex) { if (typeof regex === 'string') return regex === value; return regex.test(value); @@ -317,7 +319,7 @@ function Register({ registerInfo, loginFlow, baseUrl }) { errors.username = BAD_LOCALPART_ERROR; } if (values.password.length > 0) { - const result = zxcvbn(values.password); + const result = zxcvbn(values.password, [...MATRIX_KEYWORDS, values.username, values.email]); if (result.feedback) { errors.password = result.feedback.warning; }