fix(user): simplify error handling by skipping notification for empty token (#6252)

This commit is contained in:
Sheldon Guo 2025-02-21 11:34:13 +08:00 committed by GitHub
parent 207e05a033
commit a61895cbf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),