|
1 | | -import { Injectable, NgZone, Optional, OnDestroy } from '@angular/core'; |
| 1 | +import { Injectable, NgZone, Optional, OnDestroy, Inject } from '@angular/core'; |
2 | 2 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; |
3 | 3 | import { Observable, Subject, Subscription, of, race, from } from 'rxjs'; |
4 | 4 | import { filter, delay, first, tap, map, switchMap, debounceTime } from 'rxjs/operators'; |
| 5 | +import { DOCUMENT } from '@angular/common'; |
5 | 6 |
|
6 | 7 | import { |
7 | 8 | ValidationHandler, |
@@ -91,6 +92,7 @@ export class OAuthService extends AuthConfig implements OnDestroy { |
91 | 92 | protected urlHelper: UrlHelperService, |
92 | 93 | protected logger: OAuthLogger, |
93 | 94 | @Optional() protected crypto: HashHandler, |
| 95 | + @Inject(DOCUMENT) private document: Document, |
94 | 96 | ) { |
95 | 97 | super(); |
96 | 98 |
|
@@ -2180,14 +2182,14 @@ export class OAuthService extends AuthConfig implements OnDestroy { |
2180 | 2182 | this.clearIdTokenTimer(); |
2181 | 2183 |
|
2182 | 2184 | this.removeSilentRefreshEventListener(); |
2183 | | - const silentRefreshFrame = document.getElementById(this.silentRefreshIFrameName); |
| 2185 | + const silentRefreshFrame = this.document.getElementById(this.silentRefreshIFrameName); |
2184 | 2186 | if (silentRefreshFrame) { |
2185 | 2187 | silentRefreshFrame.remove(); |
2186 | 2188 | } |
2187 | 2189 |
|
2188 | 2190 | this.stopSessionCheckTimer(); |
2189 | 2191 | this.removeSessionCheckEventListener(); |
2190 | | - const sessionCheckFrame = document.getElementById(this.sessionCheckIFrameName); |
| 2192 | + const sessionCheckFrame = this.document.getElementById(this.sessionCheckIFrameName); |
2191 | 2193 | if (sessionCheckFrame) { |
2192 | 2194 | sessionCheckFrame.remove(); |
2193 | 2195 | } |
|
0 commit comments