angular-oauth2-oidc-sample icon indicating copy to clipboard operation
angular-oauth2-oidc-sample copied to clipboard

New to NGRX following this example

Open bilpor opened this issue 3 years ago • 0 comments

Hi, I'm trying to follow this example, but am using angular cli 13.0 and ngrx 13.0.1. I've also refereced angular-auth-oidc-client 14.1.5.

I'm getting a couple of issues :

  1. in the auth.effect.ts file

checkauth$ = createEffect(() => this.actions$.pipe( ofType(fromAuthActions.checkAuth), switchMap(() => this.authService .checkAuth() .pipe( map((isLoggedIn) => fromAuthActions.checkAuthComplete({ isLoggedIn })) ) ) ) );

on the map line where IsLoggedIn get's passed, I receive LoginResponse is not assignable to type boolean

  1. auth.selectors.ts file

`export const selectIsAuthenticated = createSelector( getAuthFeatureState, (state: AuthState) => state.isLoggedIn );

export const selectUserInfo = createSelector( getAuthFeatureState, (state: AuthState) => state.profile );`

for both constants, the getAuthFeatureState fails with no overloads matches this call.

Update: for the selector errors, changing the const getAuthFetaureState to: export const getAuthFeatureState = createFeatureSelector<AuthState>(authFeatureName);

resolves the 2 issues for the auth.selectors file, but I still have the auth.effects file issue

Apologies as I know I'm using a later library, but thought with your superior knowledge of this, that you may be able to help.

bilpor avatar Nov 07 '22 12:11 bilpor