Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat: updated password is updated (#1102)

palash-signoz0ef13a89edfc
diff --git a/frontend/src/container/MySettings/Password/index.tsx b/frontend/src/container/MySettings/Password/index.tsx
index 524e17304a..1efa58f565 100644
--- a/frontend/src/container/MySettings/Password/index.tsx
+++ b/frontend/src/container/MySettings/Password/index.tsx
@@ -1,7 +1,7 @@
import { Button, notification, Space, Typography } from 'antd';
import changeMyPassword from 'api/user/changeMyPassword';
import { isPasswordNotValidMessage, isPasswordValid } from 'pages/SignUp/utils';
-import React, { useState } from 'react';
+import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
@@ -23,6 +23,14 @@ function PasswordContainer(): JSX.Element {
ns: 'settings',
});
+ useEffect(() => {
+ if (currentPassword && !isPasswordValid(currentPassword)) {
+ setIsPasswordPolicyError(true);
+ } else {
+ setIsPasswordPolicyError(false);
+ }
+ }, [currentPassword]);
+
if (!user) {
return <div />;
}
@@ -104,11 +112,6 @@ function PasswordContainer(): JSX.Element {
onChange={(event): void => {
const updatedValue = event.target.value;
setUpdatePassword(updatedValue);
- if (!isPasswordValid(updatedValue)) {
- setIsPasswordPolicyError(true);
- } else {
- setIsPasswordPolicyError(false);
- }
}}
value={updatePassword}
/>
@@ -130,7 +133,8 @@ function PasswordContainer(): JSX.Element {
isLoading ||
currentPassword.length === 0 ||
updatePassword.length === 0 ||
- isPasswordPolicyError
+ isPasswordPolicyError ||
+ currentPassword !== updatePassword
}
loading={isLoading}
onClick={onChangePasswordClickHandler}