diff --git a/projects/frontegg-app/src/lib/frontegg-entitlements.service.ts b/projects/frontegg-app/src/lib/frontegg-entitlements.service.ts index cb210d5b..11f7a326 100644 --- a/projects/frontegg-app/src/lib/frontegg-entitlements.service.ts +++ b/projects/frontegg-app/src/lib/frontegg-entitlements.service.ts @@ -2,6 +2,7 @@ import { Subscription, PartialObserver, BehaviorSubject } from 'rxjs'; import { User, AuthState } from '@frontegg/redux-store'; import { Injectable } from '@angular/core'; import { Entitlement, LoadEntitlementsCallback, EntitledToOptions } from '@frontegg/types'; +import { UserEntitlementsResponse } from '@frontegg/rest-api'; import { FronteggState, @@ -21,7 +22,7 @@ import { FronteggAppService } from './frontegg-app.service'; providedIn: 'root', }) export class FronteggEntitlementsService { - private entitlementsStateSubject = new BehaviorSubject(undefined); + private entitlementsStateSubject = new BehaviorSubject(undefined); constructor(private fronteggAppService: FronteggAppService) { const state = this.fronteggAppService.fronteggApp.store.getState() as FronteggState; @@ -40,7 +41,7 @@ export class FronteggEntitlementsService { * @param authState */ private updateEntitlementsStateIfNeeded(authState: AuthState): void { - const entitlementsState = authState.user?.entitlements; + const entitlementsState = authState.user?.entitlements as any; if (this.entitlementsStateSubject.value === entitlementsState) { return; } @@ -56,7 +57,7 @@ export class FronteggEntitlementsService { * @returns a subscription to be able to unsubscribe */ private getEntitlementsManipulatorSubscription( - dataManipulator: (entitlements: User['entitlements']) => Result, + dataManipulator: (entitlements: any) => Result, observer: PartialObserver ): Subscription { // used for computing the entitlements result because we don't return the state itself, but a calculated one