Home > Back-end >  MSAL profileEdit does not return changed profile data to Angular app until Logout and Login
MSAL profileEdit does not return changed profile data to Angular app until Logout and Login

Time:12-01

I have an app that uses MSAL and Azure userflows to provide login, register and profile edit pages and functionality in my Angular/Ionic app, but for some reason, the profiles that are edited return the unchanged data to my app. Were I to go back to the Profile Edit userflow, i would see the correct changed profile data, but when i return to the app, it shows the old data still. Refreshing the page also doesnt work.

The strange behavior is that this profile data change will display in my Angular app as long as i log out and login.

I tried to acquireTokenSilent() & ssoSilent() passing in the params of the old profile information in hopes of getting something new but i would still receive the old profile information back from the AuthenticationResults.

I tried adding an iframeHashTimeout to the MSAL Configuration, but that didnt work.

system: {
            iframeHashTimeout: 10000,
        },

Could anyone provide incite or new ideas on how to fix this as right now, it feels like i'm just stabbing in the dark.

CodePudding user response:

I believe you are looking for ACQUIRE_TOKEN_SUCCESS. In your angular code your caching the ID in the response, that is why your old data is visible even on refresh.

MSAL handle caching in it's own so you don't need to cache the token in your application. You will find the ID Token in the result after updating the profile information of next acquire token request.

Yes you don't need to refresh the cache Msal will automatically do this for you.

  • Related