Skip to content

Commit 23acebf

Browse files
fix(MK8S-196): define __webpack_public_path__ in Jest globals, revert getToken guard
1 parent ce7210a commit 23acebf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

shell-ui/jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ module.exports = {
1111
"^@mcp-b/(.*)$": "<rootDir>/src/__mocks__/@mcp-b.js",
1212
},
1313
testEnvironment: "jsdom",
14+
globals: {
15+
__webpack_public_path__: "/",
16+
},
1417
};

shell-ui/src/auth/AuthProvider.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,9 @@ export function useAuth(): {
229229
original: auth.userData,
230230
},
231231
getToken: async () => {
232-
if (auth.userManager?.getUser) {
233-
return auth.userManager.getUser().then((user) => user?.access_token ?? null);
234-
}
235-
return auth.userData?.access_token ?? null;
232+
return auth.userManager.getUser().then((user) => {
233+
return user?.access_token;
234+
});
236235
},
237236
};
238237
} catch (e) {

0 commit comments

Comments
 (0)