From a8ee1de2a56791ce185b58efa5f06b5300b8a615 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 14 Aug 2020 14:32:24 +0300 Subject: [PATCH] feat: handle error on OAuthService loading discovery document request --- .../packages/core/src/lib/strategies/auth-flow.strategy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts index b7aa5601e2..0e86deda69 100644 --- a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts +++ b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts @@ -12,6 +12,7 @@ import { GetAppConfiguration } from '../actions/config.actions'; export abstract class AuthFlowStrategy { abstract readonly isInternalAuth: boolean; + protected store: Store; protected oAuthService: OAuthService; protected oAuthConfig: AuthConfig; abstract checkIfInternalAuth(): boolean; @@ -20,12 +21,13 @@ export abstract class AuthFlowStrategy { abstract destroy(): void; private catchError = err => { - // TODO: handle the error + return this.store.dispatch(new RestOccurError(err)); }; constructor(protected injector: Injector) { this.oAuthService = injector.get(OAuthService); this.oAuthConfig = injector.get(CORE_OPTIONS).environment.oAuthConfig; + this.store = injector.get(Store); } async init(): Promise {