Skip to content

Commit f8d9281

Browse files
authored
Fix signup regex (#1856)
1 parent f663eca commit f8d9281

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/services/auth/authService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AuthService {
3838

3939
const existingUser = await UserRepository.findByEmail(email, options)
4040

41-
const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/
41+
const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z\d])([^ \t]{8,})$/
4242

4343
if (!passwordRegex.test(password)) {
4444
throw new Error400(options.language, 'auth.passwordInvalid')

frontend/src/modules/user/user-model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const fields = {
3131
}),
3232
password: new StringField('password', label('password'), {
3333
required: true,
34-
matches: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/,
34+
matches: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z\d])([^ \t]{8,})$/,
3535
}),
3636
passwordSignin: new StringField('password', label('password'), {
3737
required: true,

0 commit comments

Comments
 (0)