-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dependency injection in Angular services
- Loading branch information
1 parent
bfd32dd
commit d5181f1
Showing
19 changed files
with
165 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...th-oidc-client/src/lib/login/response-type-validation/response-type-validation.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
projects/angular-auth-oidc-client/src/lib/storage/browser-storage.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
projects/angular-auth-oidc-client/src/lib/utils/crypto/crypto.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { DOCUMENT } from '@angular/common'; | ||
import { Inject, Injectable } from '@angular/core'; | ||
import { Injectable, inject } from '@angular/core'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class CryptoService { | ||
constructor(@Inject(DOCUMENT) private readonly doc: Document) {} | ||
private readonly document = inject<Document>(DOCUMENT); | ||
|
||
getCrypto(): any { | ||
// support for IE, (window.crypto || window.msCrypto) | ||
return ( | ||
this.doc.defaultView?.crypto || (this.doc.defaultView as any)?.msCrypto | ||
this.document.defaultView?.crypto || | ||
(this.document.defaultView as any)?.msCrypto | ||
); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
projects/angular-auth-oidc-client/src/lib/utils/platform-provider/platform.provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { isPlatformBrowser } from '@angular/common'; | ||
import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; | ||
import { Injectable, PLATFORM_ID, inject } from '@angular/core'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class PlatformProvider { | ||
private readonly platformId = inject<string>(PLATFORM_ID); | ||
|
||
isBrowser(): boolean { | ||
return isPlatformBrowser(this.platformId); | ||
} | ||
|
||
constructor(@Inject(PLATFORM_ID) private readonly platformId: string) {} | ||
} |
4 changes: 2 additions & 2 deletions
4
projects/angular-auth-oidc-client/src/lib/utils/redirect/redirect.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.