Good day:
I am trying to use your library with the NRGX library which I am using for the very first time. My observables skills are lacking currently as well.
I was wondering if you could point in the right direction to handle authorizedCallback method as an observable in my side effect class. I would like to handle like below example.
@Effect()
attemptPostAuthenticationLogic$ = this.actions$
.ofType(fromAuth.ATTEMPT_POST_AUTHENTICATION_LOGIC)
.switchMap(() => {
if (window.location.hash) {
this.oidcervice.authorizedCallback(window.location.hash)
.map(isAuthorize => new fromAuth.UserAuthenticated({ user: null, isSignedIn: true, isSignOut: false }));
} else {
return of(new fromAuth.InitializeAutneticationServiceComplete());
}
});
Do you think there is better way I could handle this. thanks
@shaannder just learning NRGX myself now :) I'm looking into this now. I'll get back as soon as I know more. Maybe @FabianGosebrink @philipooo coud helpher, they have been trying out NRGX.
Greetings Damien
Maybe when sending a auth request you can spread the state with a property "pending" and when the call comes back you can attach a new action like "AUTHENTICATION_SUCCESS" to the store.
I am not yet familiar with the angular-auth-oidc-client module so I may cant help you out on this. But I want to mention that there is a missing return statement at line 7 of your example code. return this.oidcervice.authorizedCallback...
Thanks for the feedback guys, I will keep plugging away and keep you up to date as well with my progress.
One quick observation though, currently the authorizedCallback is not observable, is it possible to make this observable or expose a similar implementation that is observable. Return a observable
thanks.
Sorry guys but I am shaannder, Never realized I was logged into a test account I a just setup.
Hi @chispaK
You can set trigger_authorization_result_event to false and use the @Output() onAuthorizationResult: EventEmitter instead.
Greetings Damien
Thanks Damien...
Do i see a library like ngrx/router-store comming up for auth ??
This is possible, but need to make shore that the used store is a global store and not a module store, if you want to reuse. and also if you subscribe to the store, then also unsubsubscribe in the ngDestroy