0

我面临如何获取更新的用户个人资料信息的问题。现在在 chrome Inspect 中:应用程序会话存储同时显示信息,旧的名字,姓氏和编辑配置文件后更新的名字,姓氏。我下面的脚本正在获取旧信息 - 名字和姓氏。

我必须使用哪个事件来获取最新的有效载荷?

我尝试了以下事件但无法获取。

// SSO_SILENT_SUCCESS

// ACQUIRE_TOKEN_SUCCESS

//HANDLE_REDIRECT_START

// SSO_SILENT_START

//ACQUIRE_TOKEN_START

// ACQUIRE_TOKEN_NETWORK_START

相关代码片段

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");        
  });

请帮忙。

4

0 回答 0