From 88db5d90d1eae3350587c89db68ff504c89a6348 Mon Sep 17 00:00:00 2001 From: balibabu Date: Tue, 26 Aug 2025 14:06:28 +0800 Subject: [PATCH] Fix: Try to fix the issue of not being able to log in through Oauth2 #9601 (#9717) ### What problem does this PR solve? Fix: Try to fix the issue of not being able to log in through Oauth2 #9601 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/hooks/auth-hooks.ts | 4 ++-- web/src/routes.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/hooks/auth-hooks.ts b/web/src/hooks/auth-hooks.ts index 208e87dea..760718652 100644 --- a/web/src/hooks/auth-hooks.ts +++ b/web/src/hooks/auth-hooks.ts @@ -1,5 +1,5 @@ +import message from '@/components/ui/message'; import authorizationUtil from '@/utils/authorization-util'; -import { message } from 'antd'; import { useEffect, useMemo, useState } from 'react'; import { useNavigate, useSearchParams } from 'umi'; @@ -28,7 +28,7 @@ export const useOAuthCallback = () => { authorizationUtil.setAuthorization(auth); newQueryParameters.delete('auth'); setSearchParams(newQueryParameters); - navigate('/knowledge'); + navigate('/'); } }, [ error, diff --git a/web/src/routes.ts b/web/src/routes.ts index ef256c3cd..2447e493a 100644 --- a/web/src/routes.ts +++ b/web/src/routes.ts @@ -151,6 +151,7 @@ const routes = [ path: Routes.Root, layout: false, component: '@/layouts/next', + wrappers: ['@/wrappers/auth'], routes: [ { path: Routes.Root,