diff --git a/releasenotes/notes/Fix-Change-Password-And-Password-Validation-1a9633368fb8dbcb.yaml b/releasenotes/notes/Fix-Change-Password-And-Password-Validation-1a9633368fb8dbcb.yaml
new file mode 100644
index 00000000..2f991744
--- /dev/null
+++ b/releasenotes/notes/Fix-Change-Password-And-Password-Validation-1a9633368fb8dbcb.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ Fix change password and password validation
+
+ 1. Show detailed error messages when changing password with previous password
+
+ 2. Fix user password validation to get better extensions (max length increased from 16 to 32, additional characters > < )
diff --git a/src/locales/en.json b/src/locales/en.json
index 422c6f6f..97738341 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -27,8 +27,8 @@
"4 2 123456789abcdef67890123456789abcdef67890123456789abcdef123456789
- 4 is Algorithm: Algorithm (0: reserved; 1: RSA; 2: DSA, 3: ECDSA; 4: Ed25519; 6:Ed448)
- 2 is Type: Algorithm used to hash the public key (0: reserved; 1: SHA-1; 2: SHA-256)
- Last parameter is Fingerprint: Hexadecimal representation of the hash result, as text
": "4 2 123456789abcdef67890123456789abcdef67890123456789abcdef123456789 - 4 is Algorithm: Algorithm (0: reserved; 1: RSA; 2: DSA, 3: ECDSA; 4: Ed25519; 6:Ed448)
- 2 is Type: Algorithm used to hash the public key (0: reserved; 1: SHA-1; 2: SHA-256)
- Last parameter is Fingerprint: Hexadecimal representation of the hash result, as text
",
"4. When you use a port range to create {resources}, multiple {resources} will be created in batches. ": "4. When you use a port range to create {resources}, multiple {resources} will be created in batches. ",
"5min": "5min",
- "8 to 16 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8 to 16 characters, at least one uppercase letter, one lowercase letter, one number and one special character.",
"8 to 16 characters, at least one uppercase letter, one lowercase letter, one number.": "8 to 16 characters, at least one uppercase letter, one lowercase letter, one number.",
+ "8 to 32 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8 to 32 characters, at least one uppercase letter, one lowercase letter, one number and one special character.",
"A command that will be sent to the container": "A command that will be sent to the container",
"A container with the same name already exists": "A container with the same name already exists",
"A dynamic scheduling algorithm that estimates the server load based on the number of currently active connections. The system allocates new connection requests to the server with the least number of current connections. Commonly used for long connection services, such as database connections and other services.": "A dynamic scheduling algorithm that estimates the server load based on the number of currently active connections. The system allocates new connection requests to the server with the least number of current connections. Commonly used for long connection services, such as database connections and other services.",
diff --git a/src/locales/ko-kr.json b/src/locales/ko-kr.json
index 2581b93c..8268f560 100644
--- a/src/locales/ko-kr.json
+++ b/src/locales/ko-kr.json
@@ -27,8 +27,8 @@
"4 2 123456789abcdef67890123456789abcdef67890123456789abcdef123456789 - 4 is Algorithm: Algorithm (0: reserved; 1: RSA; 2: DSA, 3: ECDSA; 4: Ed25519; 6:Ed448)
- 2 is Type: Algorithm used to hash the public key (0: reserved; 1: SHA-1; 2: SHA-256)
- Last parameter is Fingerprint: Hexadecimal representation of the hash result, as text
": "",
"4. When you use a port range to create {resources}, multiple {resources} will be created in batches. ": " {resources} 생성을 위해 포트 범위를 사용하면 배치로 다수의 {resources}가 생성됩니다.",
"5min": "5분",
- "8 to 16 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8 ~ 16 문자, 최소 대문자 한개, 소문자 한개, 숫자 한개, 특수 문자 한개",
"8 to 16 characters, at least one uppercase letter, one lowercase letter, one number.": "8 ~ 16 문자, 최소 대문자 한개, 소문자 한개, 숫자 한개, 특수 문자 한개",
+ "8 to 32 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8 ~ 32 문자, 최소 대문자 한개, 소문자 한개, 숫자 한개, 특수 문자 한개",
"A command that will be sent to the container": "컨테이너로 전송될 명령어",
"A container with the same name already exists": "동일한 이름의 컨테이너가 존재합니다.",
"A dynamic scheduling algorithm that estimates the server load based on the number of currently active connections. The system allocates new connection requests to the server with the least number of current connections. Commonly used for long connection services, such as database connections and other services.": "동적 스케쥴링 알고리즘은 현재 연결된 커넥션 수로 서버 로드를 예측합니다. 시스템은 최소 연결을 가진 서버로 새로운 연결을 할당합니다. 데이터베이스 연결 및 다른 서비스 처럼 오래 지속되는 연결을 갖는 서비스에 활용됩니다.",
diff --git a/src/locales/zh-hans.json b/src/locales/zh-hans.json
index 4cce1d5a..3565edd9 100644
--- a/src/locales/zh-hans.json
+++ b/src/locales/zh-hans.json
@@ -27,8 +27,8 @@
"4 2 123456789abcdef67890123456789abcdef67890123456789abcdef123456789 - 4 is Algorithm: Algorithm (0: reserved; 1: RSA; 2: DSA, 3: ECDSA; 4: Ed25519; 6:Ed448)
- 2 is Type: Algorithm used to hash the public key (0: reserved; 1: SHA-1; 2: SHA-256)
- Last parameter is Fingerprint: Hexadecimal representation of the hash result, as text
": "4 2 123456789abcdef67890123456789abcdef67890123456789abcdef123456789 - 4 是算法: 算法(0:保留;1:RSA;2:DSA;3:ECDSA;4:Ed25519;6:Ed第448章)
- 2 是类型:用于散列公钥的算法(0:保留;1:SHA-1;2:SHA-256)
- 最后一个参数是指纹:哈希结果的十六进制表示,作为文本
",
"4. When you use a port range to create {resources}, multiple {resources} will be created in batches. ": "4. 使用端口范围创建{resources}时,会批量创建多个{resources}。",
"5min": "5分钟",
- "8 to 16 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8个到16个字符,至少一个大写字母,一个小写字母,一个数字和一个特殊字符。",
"8 to 16 characters, at least one uppercase letter, one lowercase letter, one number.": "8个到16个字符,至少一个大写字母,一个小写字母,一个数字。",
+ "8 to 32 characters, at least one uppercase letter, one lowercase letter, one number and one special character.": "8个到32个字符,至少一个大写字母,一个小写字母,一个数字和一个特殊字符。",
"A command that will be sent to the container": "将发送到容器的命令",
"A container with the same name already exists": "已存在同名容器",
"A dynamic scheduling algorithm that estimates the server load based on the number of currently active connections. The system allocates new connection requests to the server with the least number of current connections. Commonly used for long connection services, such as database connections and other services.": "通过当前活跃的连接数来估计服务器负载情况的一种动态调度算法,系统把新的连接请求分配给当前连接数目最少的服务器。常用于长连接服务,例如数据库连接等服务。",
diff --git a/src/pages/auth/containers/ChangePassword/index.jsx b/src/pages/auth/containers/ChangePassword/index.jsx
index 5a3df781..10776269 100644
--- a/src/pages/auth/containers/ChangePassword/index.jsx
+++ b/src/pages/auth/containers/ChangePassword/index.jsx
@@ -86,9 +86,8 @@ export class Password extends Component {
rootStore.routing.push('/auth/login');
},
(err) => {
- const {
- reason: { message },
- } = err;
+ const { response: { data: { error: { message } = {} } = {} } = {} } =
+ err;
this.setState({
error: true,
message,
diff --git a/src/utils/validate.js b/src/utils/validate.js
index d2923e80..9f50d859 100644
--- a/src/utils/validate.js
+++ b/src/utils/validate.js
@@ -30,7 +30,7 @@ const portRangeRegex =
const ipWithMask =
/^(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\/([1-9]|[1-2]\d|3[0-2])$/;
const passwordRegex =
- /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\\[\]`~!@#$%^&*()_\-+=?:"{}|,.\\/;'])[A-Za-z\d\\[\]`~!@#$%^&*()_\-+=?:"{}|,.\\/;']{8,16}$/;
+ /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\\[\]`~!@#$%^&*><()_\-+=?:"{}|,.\\/;'])[A-Za-z\d\\[\]`~!@#$%^&*><()_\-+=?:"{}|,.\\/;']{8,32}$/;
const instancePasswordRegex =
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d\\[\]`~!@#$%^&*()_\-+=?:"{}|,.\\/;']{8,16}$/;
const emailRegex =
@@ -636,7 +636,7 @@ export const passwordValidate = (rule, value, state) => {
)
: getErrorMessage(
t(
- '8 to 16 characters, at least one uppercase letter, one lowercase letter, one number and one special character.'
+ '8 to 32 characters, at least one uppercase letter, one lowercase letter, one number and one special character.'
),
hasPrefix
);