mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Fixed password validation regex to work as expected
This commit is contained in:
@@ -129,7 +129,7 @@ router.put('/password', async (req, res) => {
|
||||
|
||||
if (newPassword.length < 8) return res.status(400).send({ error: 'New password must be at least 8 characters long.' })
|
||||
|
||||
if (!/^[0-9A-Za-z$%&~]+/.test(newPassword))
|
||||
if (!/^[0-9A-Za-z$%&~]+$/.test(newPassword))
|
||||
return res
|
||||
.status(400)
|
||||
.send({ error: 'Use only alphanumeric characters a-z, A-Z and 0-9 and symbols ^?$%&~ in the new password.' })
|
||||
|
||||
Reference in New Issue
Block a user