From: guillaume-peoch-sonarsource Date: Tue, 10 Sep 2024 08:53:19 +0000 (+0200) Subject: SONAR-22931 Clear confirm password when password is empty X-Git-Tag: 10.7.0.96327~125 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=494f07baf378e308397830d375feb5c2d01f1120;p=sonarqube.git SONAR-22931 Clear confirm password when password is empty --- diff --git a/server/sonar-web/src/main/js/components/common/UserPasswordInput.tsx b/server/sonar-web/src/main/js/components/common/UserPasswordInput.tsx index 1bced367dcd..25fe0037d02 100644 --- a/server/sonar-web/src/main/js/components/common/UserPasswordInput.tsx +++ b/server/sonar-web/src/main/js/components/common/UserPasswordInput.tsx @@ -54,6 +54,12 @@ export default function UserPasswordInput(props: Readonly) { const passwordMatch = isPasswordConfirmed(value, confirmValue); const passwordDontMatch = value !== confirmValue && confirmValue !== ''; + React.useEffect(() => { + if (value === '') { + setConfirmValue(''); + } + }, [value]); + return ( <> setIsFocused(false)}>