From e610f10d38616393125867bf6d81a095c1c28cec Mon Sep 17 00:00:00 2001 From: YANG QIA <2013xile@gmail.com> Date: Thu, 5 Dec 2024 20:43:10 +0800 Subject: [PATCH] fix(users): token is not cleared when a user has no role signing in (#5790) --- packages/core/client/src/nocobase-buildin-plugin/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/client/src/nocobase-buildin-plugin/index.tsx b/packages/core/client/src/nocobase-buildin-plugin/index.tsx index a27b741482..85e24ed73a 100644 --- a/packages/core/client/src/nocobase-buildin-plugin/index.tsx +++ b/packages/core/client/src/nocobase-buildin-plugin/index.tsx @@ -41,7 +41,6 @@ const AppSpin = () => { }; const useErrorProps = (app: Application, error: any) => { - const api = useAPIClient(); if (!error) { return {}; } @@ -57,7 +56,7 @@ const useErrorProps = (app: Application, error: any) => { type="primary" key="try" onClick={() => { - api.auth.setToken(null); + app.apiClient.auth.setToken(null); window.location.reload(); }} >