I am not sure if I am misunderstanding how things work, but I am seeing what feels like strange behavior. Once the user signs in to the OAuth provider (keycloak in my case), they are send back to the callback uri. The first actions fired from redux are as such:

However, on reload, I get the expected behavior:

The fact that USER_EXPIRED is called (and thereby makes store.oidc.isLoadingUser false) is confusing to me, and is causing some UI issues. Perhaps I'm not understanding some fundamental part of oidc, but how can I maintain in the store that the user is still being retrieved?
For some background, I call loadUser directly after the store is defined:
// in index.js
const store = createStore(rootReducer, <middleware>);
loadUser(store, userManager);
userManager is defined like this:
const userManagerConfig = {
authority: `${window.location.protocol}//${window.location.hostname}:8081/auth/realms/master`,
client_id: "vine",
redirect_uri: `${window.location.protocol}//${window.location.hostname}${
window.location.port ? `:${window.location.port}` : ""
}${window.location.pathname}`,
response_type: "code",
scope: "openid",
automaticSilentRenew: true,
accessTokenExpiringNotificationTime: 20,
revokeAccessTokenOnSignout: true,
post_logout_redirect_uri: `${window.location.protocol}//${
window.location.hostname
}${window.location.port ? `:${window.location.port}` : ""}`
};
const userManager = createUserManager(userManagerConfig);
I am not sure if I am misunderstanding how things work, but I am seeing what feels like strange behavior. Once the user signs in to the OAuth provider (keycloak in my case), they are send back to the callback uri. The first actions fired from redux are as such:
However, on reload, I get the expected behavior:
The fact that
USER_EXPIREDis called (and thereby makesstore.oidc.isLoadingUserfalse) is confusing to me, and is causing some UI issues. Perhaps I'm not understanding some fundamental part of oidc, but how can I maintain in the store that the user is still being retrieved?For some background, I call
loadUserdirectly after thestoreis defined:userManageris defined like this: