Skip to content

Commit

Permalink
undo regexp assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Oct 30, 2024
1 parent f390f8f commit 0d4ac74
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mod/user/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 0d4ac74

Please sign in to comment.