我想知道是否有办法在 Ngrx 效果中使用 Msal angular 的 loginRedirect(): void 函数而不是 loginPopup(): Promise。
我可以使用 loginPopup() 但由于 loginRedirect() 的 void 返回类型,它破坏了我的 ngrx 效果链。由于移动设备上的弹出窗口问题,我无法使用 loginPopup() 函数。
下面是适用于 loginPopup() 的代码: Promise
@Effect()
msalAuthLogin$ = this.actions$.pipe(
ofType(MsalAuthActionTypes.Login),
switchMap(() =>
this.msalAuthService.loginPopup().pipe(
map(id_token => new AcquireTokenSilent()),
catchError(error => of(new LoginFail({ error })))
)
)
);