diff --git a/hooks/usePasswordChange.ts b/hooks/usePasswordChange.ts index 0c732a2..b8347f0 100644 --- a/hooks/usePasswordChange.ts +++ b/hooks/usePasswordChange.ts @@ -17,6 +17,11 @@ export const usePassword = (): ChangePasswordResult => { async function changePassword(currentPassword: string, newPassword: string): Promise { setIsLoading(true) + if(currentPassword === newPassword){ + showTemporaryErrorMessage("The new password must differ from the existing password.") + setIsLoading(false) + return; + } try { const currentPwSha256digest = await hashSha256(currentPassword) const newPwSha256digest = await hashSha256(newPassword)