I am facing issue with how to fetch updated user profile information. Right now in chrome Inspect : Application Session storage is showing both information, old first name, last name and after edit profile updated first name, last name. My below script is fetching old info - first name and last name.
Which event i have to use to get latest payload?
I have try below event but not able to fetch.
// SSO_SILENT_SUCCESS
// ACQUIRE_TOKEN_SUCCESS
//HANDLE_REDIRECT_START
// SSO_SILENT_START
//ACQUIRE_TOKEN_START
// ACQUIRE_TOKEN_NETWORK_START
Relevant Code Snippets
this.msalBroadcastService.msalSubject$
.subscribe((result: EventMessage) => {
console.log(result);
console.warn("Home component. LOgin Success");
const payload = result.payload as AuthenticationResult;
localStorage.setItem('IdToken', payload.idToken);
this.authService.instance.setActiveAccount(payload.account);
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.SSO_SILENT_SUCCESS)
)
.subscribe((result: EventMessage) => {
console.warn("notification. SSO_SILENT_SUCCESS");
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.ACQUIRE_TOKEN_SUCCESS)
)
.subscribe((result: EventMessage) => {
console.warn("notification. ACQUIRE_TOKEN_SUCCESS");
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.HANDLE_REDIRECT_START)
)
.subscribe((result: EventMessage) => {
console.warn("notification. HANDLE_REDIRECT_START");
});
this.msalBroadcastService.msalSubject$
.subscribe((result: EventMessage) => {
console.warn("notification Remove Pipe");
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.SSO_SILENT_START)
)
.subscribe((result: EventMessage) => {
console.warn("notification. SSO_SILENT_START");
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.ACQUIRE_TOKEN_START)
)
.subscribe((result: EventMessage) => {
console.warn("notification. ACQUIRE_TOKEN_START");
});
this.msalBroadcastService.msalSubject$
.pipe(
filter((msg: EventMessage) => msg.eventType === EventType.ACQUIRE_TOKEN_NETWORK_START)
)
.subscribe((result: EventMessage) => {
console.warn("notification. ACQUIRE_TOKEN_NETWORK_START");
});
Please help.