From ac50a4fb05b0d2041d8e9395793783198a85b515 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:45:52 +0300 Subject: [PATCH] B: Fix token validation issue --- .../src/features/auth/pages/password-change-page.tsx | 10 +++++----- .../src/features/auth/pages/restore-password-page.tsx | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rsconcept/frontend/src/features/auth/pages/password-change-page.tsx b/rsconcept/frontend/src/features/auth/pages/password-change-page.tsx index dee1f561..6156ed1d 100644 --- a/rsconcept/frontend/src/features/auth/pages/password-change-page.tsx +++ b/rsconcept/frontend/src/features/auth/pages/password-change-page.tsx @@ -19,8 +19,8 @@ function useTokenValidation(token: string, isPending: boolean) { const validate = async () => { if (!isTokenValidating && !isPending) { - await validateToken({ token }); setIsTokenValidating(true); + await validateToken({ token }); } }; return { isTokenValidating, validate }; @@ -44,10 +44,7 @@ export function Component() { void resetPassword({ password: newPassword, token: token - }).then(() => { - router.replace({ path: urls.home }); - router.push({ path: urls.login }); - }); + }).then(() => router.replace({ path: urls.login })); } } @@ -83,6 +80,9 @@ export function Component() { setNewPasswordRepeat(event.target.value); }} /> + {newPasswordRepeat && newPassword !== newPasswordRepeat ? ( +