From 0d4ac74cded44ddb9cefa82135e7559282ee7186 Mon Sep 17 00:00:00 2001 From: dbauszus-glx Date: Wed, 30 Oct 2024 15:37:51 +0000 Subject: [PATCH] undo regexp assignment --- mod/user/register.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/user/register.js b/mod/user/register.js index 10ad6df4c1..9f00de5498 100644 --- a/mod/user/register.js +++ b/mod/user/register.js @@ -29,8 +29,6 @@ const languageTemplates = require('../utils/languageTemplates') const view = require('../view') -process.env.PASSWORD_REGEXP ??= '(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])^.{10,}$' - /** @function register @@ -233,7 +231,7 @@ function checkUserBody(req, res) { if (!req.body.password) return res.status(400).send('No password provided') // Create regex to text password complexity from env or set default. - const passwordRgx = new RegExp(process.env.PASSWORD_REGEXP) + const passwordRgx = new RegExp(process.env.PASSWORD_REGEXP || '(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])^.{10,}$') // Test whether the provided password is valid. if (!passwordRgx.test(req.body.password)) {