diff --git a/web/service/use-common.ts b/web/service/use-common.ts index 3e01b721e8..b843cd5db1 100644 --- a/web/service/use-common.ts +++ b/web/service/use-common.ts @@ -116,7 +116,17 @@ export const useIsLogin = () => { queryKey: [NAME_SPACE, 'is-login'], staleTime: 0, gcTime: 0, - queryFn: () => get('/login/status'), + queryFn: async (): Promise => { + try { + await get('/api/account/profile', { + silent: true, + }) // if code is 401, not logged in + } + catch { + return { logged_in: false } + } + return { logged_in: true } + }, }) }