From 1ce5ea0fe114a4295e67062fa6589b8f7f4277aa Mon Sep 17 00:00:00 2001 From: Sheldon Guo Date: Thu, 20 Feb 2025 09:21:45 +0800 Subject: [PATCH] fix(user): simplify error handling by skipping notification for empty token --- packages/core/client/src/user/CurrentUserProvider.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/core/client/src/user/CurrentUserProvider.tsx b/packages/core/client/src/user/CurrentUserProvider.tsx index c815f8cfd6..2c8a52c2e1 100644 --- a/packages/core/client/src/user/CurrentUserProvider.tsx +++ b/packages/core/client/src/user/CurrentUserProvider.tsx @@ -44,13 +44,7 @@ export const CurrentUserProvider = (props) => { api .request({ url: '/auth:check', - skipNotify: (error) => { - const errs = api.toErrMessages(error); - if (errs.find((error: { code?: string }) => error.code === 'EMPTY_TOKEN')) { - return true; - } - return false; - }, + skipNotify: true, skipAuth: true, }) .then((res) => res?.data),