AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.64k stars 2.65k forks source link

@azure/msal-angular - MsalBroadcastService: inProgress$ does not emit last value #3253

Closed mdarefull closed 3 years ago

mdarefull commented 3 years ago

Library

Framework

Description

In the documentation for handling redirects it is recommended to use MsalRedirectComponentto handle the redirects and MsalBroadcastService.inProgress$ for, quote Pages that wish to perform functions following redirects...

The problem is that inProgress$ won't emit the last value, so if the page subscribes after the redirect has been handled by MsalRedirectComponent, the subscription will never execute. It is a nuance mainly because of race conditions, I cannot ensure a given component will subscribe before/after the redirects are handled causing the code to no execute. Not using the subscription means the opposite, the possibility for the code to run while the interaction is still in progress.

Identity Provider

jo-arroyo commented 3 years ago

@mdarefull Thanks for your feedback. We are aware this has been an issue for our customers, and a fix with updated documentation is scheduled for the next release.