|
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 |
|
@@ -2185,14 +2187,14 @@ export class OAuthService extends AuthConfig implements OnDestroy { |
2185 | 2187 | this.clearIdTokenTimer(); |
2186 | 2188 |
|
2187 | 2189 | this.removeSilentRefreshEventListener(); |
2188 | | - const silentRefreshFrame = document.getElementById(this.silentRefreshIFrameName); |
| 2190 | + const silentRefreshFrame = this.document.getElementById(this.silentRefreshIFrameName); |
2189 | 2191 | if (silentRefreshFrame) { |
2190 | 2192 | silentRefreshFrame.remove(); |
2191 | 2193 | } |
2192 | 2194 |
|
2193 | 2195 | this.stopSessionCheckTimer(); |
2194 | 2196 | this.removeSessionCheckEventListener(); |
2195 | | - const sessionCheckFrame = document.getElementById(this.sessionCheckIFrameName); |
| 2197 | + const sessionCheckFrame = this.document.getElementById(this.sessionCheckIFrameName); |
2196 | 2198 | if (sessionCheckFrame) { |
2197 | 2199 | sessionCheckFrame.remove(); |
2198 | 2200 | } |
|
0 commit comments