From 4d9e1324e965757ad3b3ae02c9eb0079a08e1cea Mon Sep 17 00:00:00 2001 From: Jialei Date: Thu, 8 Sep 2022 15:07:59 +0800 Subject: [PATCH] fix(console): can not reset password --- console/src/api/ApiHeader.tsx | 5 +++-- console/src/pages/Home/ResetPassword.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/console/src/api/ApiHeader.tsx b/console/src/api/ApiHeader.tsx index 12cde8d346..72da54dfa1 100644 --- a/console/src/api/ApiHeader.tsx +++ b/console/src/api/ApiHeader.tsx @@ -48,8 +48,9 @@ export default function ApiHeader() { if (error.response?.status === 401 && error.config.method === 'get') { const withUnAuthRoute = - ['/login', '/signup', '/create-account'].filter((path) => winLocation.pathname.includes(path)) - .length > 0 + ['/login', '/signup', '/create-account', '/reset'].filter((path) => + winLocation.pathname.includes(path) + ).length > 0 const search = qs.parse(winLocation.search, { ignoreQueryPrefix: true }) let { redirect } = search if (redirect && typeof redirect === 'string') { diff --git a/console/src/pages/Home/ResetPassword.tsx b/console/src/pages/Home/ResetPassword.tsx index 21644f7ace..e41f35242c 100644 --- a/console/src/pages/Home/ResetPassword.tsx +++ b/console/src/pages/Home/ResetPassword.tsx @@ -18,7 +18,7 @@ export default function ResetPassword() { async (password: string) => { await resetPassword(password, verification) toaster.positive(t('Reset Password Success'), { autoHideDuration: 3000 }) - history.push('/') + history.push('/login') }, [verification, t, history] )