From 9e95c731505907edacd9ddeffcd3d71ae05a4588 Mon Sep 17 00:00:00 2001 From: Johannes Huster Date: Wed, 3 Jun 2020 13:06:41 +0200 Subject: [PATCH] Fix issue with ambient type in constructor when running Universal with Ivy --- projects/lib/src/oauth-service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index 04e4ec8e..37ba554f 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -102,6 +102,7 @@ export class OAuthService extends AuthConfig implements OnDestroy { protected inImplicitFlow = false; protected saveNoncesInLocalStorage = false; + private document: Document; constructor( protected ngZone: NgZone, @@ -112,12 +113,15 @@ export class OAuthService extends AuthConfig implements OnDestroy { protected urlHelper: UrlHelperService, protected logger: OAuthLogger, @Optional() protected crypto: HashHandler, - @Inject(DOCUMENT) private document: Document + @Inject(DOCUMENT) document: any ) { super(); this.debug('angular-oauth2-oidc v8-beta'); + // See https://github.com/manfredsteyer/angular-oauth2-oidc/issues/773 for why this is needed + this.document = document; + this.discoveryDocumentLoaded$ = this.discoveryDocumentLoadedSubject.asObservable(); this.events = this.eventsSubject.asObservable();