Description
In lib/src/zitadelAuth.ts, the loadUserInfo option is hardcoded to true when creating the UserManager instance:
const userManager = new UserManager({
userStore: new WebStorageStateStore({ store: window.localStorage }),
loadUserInfo: true, // hardcoded
...authConfig,
});
Environment
@zitadel/react: 1.1.0
Describe the problem caused by this code
Since ZitadelConfig extends Partial, users should be able to configure loadUserInfo, but the hardcoded value prevents this.
Why this matters
- Unnecessary network requests: Users who enable "User Info inside ID Token" in ZITADEL console don't need to call the userinfo endpoint, but they can't disable it.
- Flexibility: According to https://authts.github.io/oidc-client-ts/interfaces/UserManagerSettings.html, loadUserInfo defaults to false. The SDK should respect user configuration while providing a sensible default for ZITADEL.
- ZITADEL configuration options: As per https://zitadel.com/docs/apis/openidoauth/endpoints, users can enable id_token_userinfo_assertion ("User Info inside ID Token") to include user claims directly in the ID token, making the userinfo endpoint call redundant.
Expected behavior
Users should be able to set loadUserInfo: false in their ZitadelConfig when they have "User Info inside ID Token" enabled in ZITADEL.
Suggested fix
const userManager = new UserManager({
userStore: new WebStorageStateStore({ store: window.localStorage }),
loadUserInfo: zitadelConfig.loadUserInfo ?? true,
...authConfig,
});
This maintains backward compatibility (defaults to true) while allowing users to override the setting.
Description
In
lib/src/zitadelAuth.ts, theloadUserInfooption is hardcoded totruewhen creating theUserManagerinstance:Environment
@zitadel/react: 1.1.0Describe the problem caused by this code
Since ZitadelConfig extends Partial, users should be able to configure loadUserInfo, but the hardcoded value prevents this.
Why this matters
Expected behavior
Users should be able to set loadUserInfo: false in their ZitadelConfig when they have "User Info inside ID Token" enabled in ZITADEL.
Suggested fix
This maintains backward compatibility (defaults to
true) while allowing users to override the setting.