Currently, I have an API call to fetch user information for all pages. The challenge is that if any changes are required, I have to update the API calls for all pages individually. I’d like to avoid storing user information in cookies, local storage, or session storage, as some checks involve user categories (e.g., certain user categories may or may not be allowed to view specific content and want to avoid user edit).
The API I’m using is an RPC (no input) that retrieves user information based on the JWT. A function extracts the auth_id and then fetches all user details.
I was considering implementing a component (like the menu or even an empty component) that calls the API internally and returns the required values. Another idea was to use context, but I’m unsure how to retrieve the output effectively when using context.
What solutions do you typically use for this kind of scenario?