From aebaa4d906b382e937fad6459f79e7df99d0561e Mon Sep 17 00:00:00 2001 From: Benjamin Cavy Date: Fri, 17 Jan 2025 09:56:21 +0100 Subject: [PATCH] feat: allow more special characters in password Fix #927 --- app/fr/maif/izanami/models/User.scala | 2 +- izanami-frontend/src/utils/patterns.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/fr/maif/izanami/models/User.scala b/app/fr/maif/izanami/models/User.scala index 9de10d4eb..03a39d624 100644 --- a/app/fr/maif/izanami/models/User.scala +++ b/app/fr/maif/izanami/models/User.scala @@ -407,7 +407,7 @@ object Rights { } object User { - val PASSWORD_REGEXP: Regex = "^[a-zA-Z0-9_]{8,50}$".r + val PASSWORD_REGEXP: Regex = "^[a-zA-Z0-9_\\-+=;: ,?!$%'\"^@*<>&|#/\\\\()\\[\\]{}]{8,50}$".r implicit val rightLevelReads: Reads[RightLevel] = { json => json diff --git a/izanami-frontend/src/utils/patterns.tsx b/izanami-frontend/src/utils/patterns.tsx index d5be1fdd1..060d973c1 100644 --- a/izanami-frontend/src/utils/patterns.tsx +++ b/izanami-frontend/src/utils/patterns.tsx @@ -1,4 +1,4 @@ -export const PASSWORD_REGEXP = /^[a-zA-Z0-9_]{8,100}$/; +export const PASSWORD_REGEXP = /^[a-zA-Z0-9_\-+=;:,?!$%'"^@*<>&|#\/\\()\[\]{}]{8,100}$/; export const USERNAME_REGEXP = /^[a-zA-Z0-9_-]+$/; export const FEATURE_NAME_REGEXP = /^[ a-zA-Z0-9_\-:]+$/; export const TENANT_NAME_REGEXP = /^[a-z0-9-]+$/;