0

I'm using login redirect with msal library in Angular. After redirecting and successfully login I'm redirected back to my app login page but it takes so much time to get the subscription result from this.msalBroadcastService.msalSubject$ in order to set the active account that the app manages to render the login screen for a second and then redirect to home page. This flickering for 1-2 seconds is not okay for the business.

I'm handling the subscription in the app component for the highest chance to catch it as early as possible but it is still very slow. image

Here is my config

export function MSALInstanceFactory(): IPublicClientApplication {
  return new PublicClientApplication({
    auth: {
      clientId: authConfig.msalConfig.auth.clientId,
      authority: authConfig.msalConfig.auth.authority,
      redirectUri: window.location.origin,
      postLogoutRedirectUri: window.location.origin
    },
    cache: {
      cacheLocation: BrowserCacheLocation.LocalStorage,
      storeAuthStateInCookie: true
    },
    system: {
      allowNativeBroker: false,
    }
  });
}

Is this msalSubject$ making a request in order to get the data and that's why it's so slow? Am I missing something or is there a configuration that can help to catch the successful login after redirection faster so I can at least show the loading indicator that the information is still processing?

Thank you in advance!

0 Answers0