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

Co-authored-by: Ernst Lawende <ernstl@bastion365.nl>
This commit is contained in:
elawende 2025-04-08 15:43:06 +02:00 committed by GitHub
parent 391a5f3bdd
commit cfa202e89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();