mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix(auth): enhance error handling for 401 status with specific error codes
This commit is contained in:
parent
61f98aaa33
commit
69575af6a9
@ -61,7 +61,7 @@ export function authCheckMiddleware({ app }: { app: Application }) {
|
||||
app.apiClient.auth.setToken(newToken);
|
||||
}
|
||||
|
||||
if (error.status === 401) {
|
||||
if (error.status === 401 && firstError?.code && AuthErrorCode[firstError.code]) {
|
||||
app.apiClient.auth.setToken('');
|
||||
if (pathname === app.getHref('signin') && firstError?.code !== AuthErrorCode.EMPTY_TOKEN && error.config) {
|
||||
error.config.skipNotify = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user