fix(OIDC): Use new access_token after refresh (#4853)

Co-authored-by: Ernst Lawende <ernstl@bastion365.nl>
This commit is contained in:
elawendeandErnst Lawende authored and GitHub committed 2025-04-08 09:43:06 -04:00
1 parent 391a5f3bdd
commit cfa202e89a
1 file changed
+13
@@ -147,6 +147,19 @@ function OpenIdConnectRoutes({ oidc, routerBasename, userAuthenticationService }
});
}, []);
useEffect(() => {
const userLoadedHandler = user => {
userAuthenticationService.setUser(user);
};
userManager.events.addUserLoaded(userLoadedHandler);
// Cleanup on component unmount.
return () => {
userManager.events.removeUserLoaded(userLoadedHandler);
};
}, []);
const oidcAuthority = oidc[0].authority;
const location = useLocation();