From a542b57c70b1a04ae93f278788700fe25899851d Mon Sep 17 00:00:00 2001 From: CHEYNE Date: Fri, 26 Jan 2024 21:24:26 +0800 Subject: [PATCH] [#1742] fix(web): fix oauth mode redirect (#1743) ### What changes were proposed in this pull request? Fix OAuth mode redirect. ### Why are the changes needed? Fix: #1742 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? N/A --- web/lib/provider/session.js | 4 ++-- web/lib/utils/axios/checkStatus.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/lib/provider/session.js b/web/lib/provider/session.js index 2bbe4b94339..762daa78598 100644 --- a/web/lib/provider/session.js +++ b/web/lib/provider/session.js @@ -48,7 +48,7 @@ const AuthProvider = ({ children }) => { dispatch(setStoreVersion('')) dispatch(setAuthToken('')) - router.push('/login') + router.push('/ui/login') } useEffect(() => { @@ -64,7 +64,7 @@ const AuthProvider = ({ children }) => { dispatch(setAuthToken(token)) dispatch(initialVersion()) } else { - router.replace('/login') + router.push('/ui/login') } } } diff --git a/web/lib/utils/axios/checkStatus.ts b/web/lib/utils/axios/checkStatus.ts index dc656353c91..9073345feb9 100644 --- a/web/lib/utils/axios/checkStatus.ts +++ b/web/lib/utils/axios/checkStatus.ts @@ -44,7 +44,7 @@ export function checkStatus(status: number, msg: string, errorMessageMode: Error localStorage.removeItem('accessToken') localStorage.removeItem('version') - Router().replace('/login') + Router().push('/ui/login') break case 403: