I ultimately fixed my issue by using the MsalService.handleRedirectObservable() method and subscribing to the results, then checking for an active account:
this.msal.handleRedirectObservable().subscribe(() => {
const account = this.msal.instance.getActiveAccount();
if (account) {
// do post-login stuff
} else {
this.msalBroadcastService.inProgress$.pipe(
filter(status => status === InteractionStatus.None),
take(1))
.subscribe(() => {
// do post-login stuff
});
}
});
If you try to call the getActiveAccount method before the MsalService gets initialized it'll throw an error and it seems like handleRedirectObservable did the initialization I needed to be able to check for an active account, in which case I would either proceed or branch off to do the login logic. There's probably a cleaner way to do this?