From 1d69714951cef7c086563e11b79c515e6437499f Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Thu, 30 Jun 2022 17:24:15 +0200 Subject: [PATCH] MAINT: nicer error messages for user name/password invalid --- conf/core/server.conf | 2 +- src/main/java/org/caosdb/server/utils/ServerMessages.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/core/server.conf b/conf/core/server.conf index 5cad243f..57744250 100644 --- a/conf/core/server.conf +++ b/conf/core/server.conf @@ -209,7 +209,7 @@ USER_NAME_VALID_REGEX=^[\\w\\.][\\w\\.-]*{1,32}$ USER_NAME_INVALID_MESSAGE=User names must have a length from 1 to 32 characters. They must contain only latin letters a-z (upper case or lower case), number 0-9, dots (.), underscores (_), or hyphens (-). They must no start with a hyphen. PASSWORD_VALID_REGEX=^((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\p{Punct}]).{8,128})$ -PASSWORD_INVALID_MESSAGE=blablabla +PASSWORD_INVALID_MESSAGE=Passwords must have a length from 8 to 128 characters. THe must contain at least one [A-Z], one [a-z], one [0-9] and a special character e.g. [!ยง$%&/()=?.;,:#+*+~]. # -------------------------------------------------- # Extensions diff --git a/src/main/java/org/caosdb/server/utils/ServerMessages.java b/src/main/java/org/caosdb/server/utils/ServerMessages.java index 0ec31162..835087ce 100644 --- a/src/main/java/org/caosdb/server/utils/ServerMessages.java +++ b/src/main/java/org/caosdb/server/utils/ServerMessages.java @@ -403,7 +403,7 @@ public class ServerMessages { return new Message( MessageType.Error, MessageCode.MESSAGE_CODE_UNKNOWN, - "This password does not match the current policies for passwords: " + policy); + "The password does not comply with the current policies for passwords: " + policy); } public static final Message AFFILIATION_ERROR = @@ -610,7 +610,7 @@ public class ServerMessages { return new Message( MessageType.Error, MessageCode.MESSAGE_CODE_UNKNOWN, - "The user name does not comply with the policies for user names: " + policy); + "The user name does not comply with the current policies for user names: " + policy); } public static final Message CANNOT_DELETE_YOURSELF() { -- GitLab