oidc-client icon indicating copy to clipboard operation
oidc-client copied to clipboard

OidcUser is not cached in useOidcUser

Open tobnobs opened this issue 2 years ago • 3 comments

Issue and Steps to Reproduce

The useOidcUser hook calls the userInfoEndpoint on every page load (oidcUser is never put in Storage/cached).

Versions

6.10.9

Screenshots

Expected

oidcUser should be stored in the specified Storage and if set userInfoAsync or the fetch inside it should not be called again.

Actual

User info is only stored in state and there is no conditional around the userInfoAsync call to not fetch user info if it already has been.

Additional Details

  • Installed packages:

tobnobs avatar Oct 31 '22 17:10 tobnobs

Hi @tobnobs , thank you for your issue. Yes, your are completly right !

guillaume-chervet avatar Oct 31 '22 21:10 guillaume-chervet

Hello i have the same issue OidcUser is not stored or cached somewhere

chaimabenkaddour avatar Jan 23 '23 14:01 chaimabenkaddour

Is there a sense of how difficult this would be to implement? I'm working on a project that would benefit from the improvement and we might be able to spend a cycle or two on making this improvement.

slifty avatar Apr 25 '24 21:04 slifty