@bcweed/authentication-lib 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.editorconfig +17 -0
  2. package/AngularAuthenticationLibrary.esproj +10 -0
  3. package/CHANGELOG.md +16 -0
  4. package/README.md +59 -0
  5. package/angular.json +66 -0
  6. package/obj/Debug/AngularAuthenticationLibrary.esproj.CoreCompileInputs.cache +0 -0
  7. package/obj/Debug/AngularAuthenticationLibrary.esproj.FileListAbsolute.txt +1 -0
  8. package/obj/Debug/package.g.props +52 -0
  9. package/package.json +61 -0
  10. package/projects/authentication-lib/README.md +63 -0
  11. package/projects/authentication-lib/ng-package.json +7 -0
  12. package/projects/authentication-lib/package.json +27 -0
  13. package/projects/authentication-lib/src/lib/auth-callback/auth-callback.component.html +1 -0
  14. package/projects/authentication-lib/src/lib/auth-callback/auth-callback.component.scss +0 -0
  15. package/projects/authentication-lib/src/lib/auth-callback/auth-callback.component.spec.ts +23 -0
  16. package/projects/authentication-lib/src/lib/auth-callback/auth-callback.component.ts +68 -0
  17. package/projects/authentication-lib/src/lib/auth.service.spec.ts +16 -0
  18. package/projects/authentication-lib/src/lib/auth.service.ts +213 -0
  19. package/projects/authentication-lib/src/lib/authentication-error/authentication-error.component.html +7 -0
  20. package/projects/authentication-lib/src/lib/authentication-error/authentication-error.component.scss +0 -0
  21. package/projects/authentication-lib/src/lib/authentication-error/authentication-error.component.spec.ts +23 -0
  22. package/projects/authentication-lib/src/lib/authentication-error/authentication-error.component.ts +32 -0
  23. package/projects/authentication-lib/src/lib/authentication-lib.module.ts +26 -0
  24. package/projects/authentication-lib/src/lib/authentication-lib.tokens.ts +4 -0
  25. package/projects/authentication-lib/src/lib/login/login.component.html +1 -0
  26. package/projects/authentication-lib/src/lib/login/login.component.scss +0 -0
  27. package/projects/authentication-lib/src/lib/login/login.component.spec.ts +23 -0
  28. package/projects/authentication-lib/src/lib/login/login.component.ts +28 -0
  29. package/projects/authentication-lib/src/lib/login-menu/login-menu.component.html +39 -0
  30. package/projects/authentication-lib/src/lib/login-menu/login-menu.component.scss +7 -0
  31. package/projects/authentication-lib/src/lib/login-menu/login-menu.component.spec.ts +23 -0
  32. package/projects/authentication-lib/src/lib/login-menu/login-menu.component.ts +51 -0
  33. package/projects/authentication-lib/src/lib/logout/logout.component.html +1 -0
  34. package/projects/authentication-lib/src/lib/logout/logout.component.scss +0 -0
  35. package/projects/authentication-lib/src/lib/logout/logout.component.spec.ts +23 -0
  36. package/projects/authentication-lib/src/lib/logout/logout.component.ts +29 -0
  37. package/projects/authentication-lib/src/lib/logout-callback/logout-callback.component.html +0 -0
  38. package/projects/authentication-lib/src/lib/logout-callback/logout-callback.component.scss +0 -0
  39. package/projects/authentication-lib/src/lib/logout-callback/logout-callback.component.spec.ts +23 -0
  40. package/projects/authentication-lib/src/lib/logout-callback/logout-callback.component.ts +27 -0
  41. package/projects/authentication-lib/src/lib/route-history.service.spec.ts +16 -0
  42. package/projects/authentication-lib/src/lib/route-history.service.ts +31 -0
  43. package/projects/authentication-lib/src/public-api.ts +14 -0
  44. package/projects/authentication-lib/tsconfig.lib.json +15 -0
  45. package/projects/authentication-lib/tsconfig.lib.prod.json +11 -0
  46. package/projects/authentication-lib/tsconfig.spec.json +15 -0
  47. package/tsconfig.json +32 -0
package/.editorconfig ADDED
@@ -0,0 +1,17 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.ts]
12
+ quote_type = single
13
+ ij_typescript_use_double_quotes = false
14
+
15
+ [*.md]
16
+ max_line_length = off
17
+ trim_trailing_whitespace = false
@@ -0,0 +1,10 @@
1
+ <Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.2752196">
2
+ <PropertyGroup>
3
+ <StartupCommand>npm start</StartupCommand>
4
+ <JavaScriptTestFramework>Jasmine</JavaScriptTestFramework>
5
+ <!-- Allows the build (or compile) script located on package.json to run on Build -->
6
+ <ShouldRunBuildScript>false</ShouldRunBuildScript>
7
+ <!-- Folder where production build objects will be placed -->
8
+ <BuildOutputFolder>$(MSBuildProjectDirectory)\dist\AngularAuthenticationLibrary\browser\</BuildOutputFolder>
9
+ </PropertyGroup>
10
+ </Project>
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ This file explains how Visual Studio created the project.
2
+
3
+ The following tools were used to generate this project:
4
+ - Angular CLI (ng)
5
+
6
+ The following steps were used to generate this project:
7
+ - Create Angular project with ng: `ng new AngularAuthenticationLibrary --defaults --skip-install --skip-git --no-standalone `.
8
+ - Update angular.json with port.
9
+ - Create project file (`AngularAuthenticationLibrary.esproj`).
10
+ - Create `launch.json` to enable debugging.
11
+ - Update package.json to add `jest-editor-support`.
12
+ - Update `start` script in `package.json` to specify host.
13
+ - Add `karma.conf.js` for unit tests.
14
+ - Update `angular.json` to point to `karma.conf.js`.
15
+ - Add project to solution.
16
+ - Write this file.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # AuthenticationLib
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.19.
4
+
5
+ ## Development server
6
+
7
+ To start a local development server, run:
8
+
9
+ ```bash
10
+ ng serve
11
+ ```
12
+
13
+ Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14
+
15
+ ## Code scaffolding
16
+
17
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
18
+
19
+ ```bash
20
+ ng generate component component-name
21
+ ```
22
+
23
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24
+
25
+ ```bash
26
+ ng generate --help
27
+ ```
28
+
29
+ ## Building
30
+
31
+ To build the project run:
32
+
33
+ ```bash
34
+ ng build
35
+ ```
36
+
37
+ This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38
+
39
+ ## Running unit tests
40
+
41
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
42
+
43
+ ```bash
44
+ ng test
45
+ ```
46
+
47
+ ## Running end-to-end tests
48
+
49
+ For end-to-end (e2e) testing, run:
50
+
51
+ ```bash
52
+ ng e2e
53
+ ```
54
+
55
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
56
+
57
+ ## Additional Resources
58
+
59
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
package/angular.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "authentication-lib": {
7
+ "projectType": "library",
8
+ "root": "projects/authentication-lib",
9
+ "sourceRoot": "projects/authentication-lib/src",
10
+ "prefix": "lib",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular/build:ng-packagr",
14
+ "options": {
15
+ "project": "projects/authentication-lib/ng-package.json"
16
+ },
17
+ "configurations": {
18
+ "production": {
19
+ "tsConfig": "projects/authentication-lib/tsconfig.lib.prod.json"
20
+ },
21
+ "development": {
22
+ "tsConfig": "projects/authentication-lib/tsconfig.lib.json"
23
+ }
24
+ },
25
+ "defaultConfiguration": "production"
26
+ },
27
+ "test": {
28
+ "builder": "@angular/build:karma",
29
+ "options": {
30
+ "tsConfig": "projects/authentication-lib/tsconfig.spec.json",
31
+ "polyfills": [
32
+ "zone.js",
33
+ "zone.js/testing"
34
+ ]
35
+ }
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "schematics": {
41
+ "@schematics/angular:component": {
42
+ "type": "component"
43
+ },
44
+ "@schematics/angular:directive": {
45
+ "type": "directive"
46
+ },
47
+ "@schematics/angular:service": {
48
+ "type": "service"
49
+ },
50
+ "@schematics/angular:guard": {
51
+ "typeSeparator": "."
52
+ },
53
+ "@schematics/angular:interceptor": {
54
+ "typeSeparator": "."
55
+ },
56
+ "@schematics/angular:module": {
57
+ "typeSeparator": "."
58
+ },
59
+ "@schematics/angular:pipe": {
60
+ "typeSeparator": "."
61
+ },
62
+ "@schematics/angular:resolver": {
63
+ "typeSeparator": "."
64
+ }
65
+ }
66
+ }
@@ -0,0 +1 @@
1
+ E:\work\AngularAuthenticationLibrary\AngularAuthenticationLibrary\obj\Debug\AngularAuthenticationLibrary.esproj.CoreCompileInputs.cache
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project>
3
+ <PropertyGroup>
4
+ <PackageJsonName Condition="$(PackageJsonName) == ''">@bcweed/authentication-lib</PackageJsonName>
5
+ <PackageJsonVersion Condition="$(PackageJsonVersion) == ''">0.0.0</PackageJsonVersion>
6
+ <PackageJsonPrivate Condition="$(PackageJsonPrivate) == ''">false</PackageJsonPrivate>
7
+ <PackageJsonPublishconfigAccess Condition="$(PackageJsonPublishconfigAccess) == ''">public</PackageJsonPublishconfigAccess>
8
+ <PackageJsonDescription Condition="$(PackageJsonDescription) == ''">This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.19.</PackageJsonDescription>
9
+ <PackageJsonHomepage Condition="$(PackageJsonHomepage) == ''">https://github.com/cartier966/AngularAuthenticationLibrary#readme</PackageJsonHomepage>
10
+ <PackageJsonBugsUrl Condition="$(PackageJsonBugsUrl) == ''">https://github.com/cartier966/AngularAuthenticationLibrary/issues</PackageJsonBugsUrl>
11
+ <PackageJsonRepositoryType Condition="$(PackageJsonRepositoryType) == ''">git</PackageJsonRepositoryType>
12
+ <PackageJsonRepositoryUrl Condition="$(PackageJsonRepositoryUrl) == ''">git+https://github.com/cartier966/AngularAuthenticationLibrary.git</PackageJsonRepositoryUrl>
13
+ <PackageJsonLicense Condition="$(PackageJsonLicense) == ''">ISC</PackageJsonLicense>
14
+ <PackageJsonAuthor Condition="$(PackageJsonAuthor) == ''"></PackageJsonAuthor>
15
+ <PackageJsonType Condition="$(PackageJsonType) == ''">commonjs</PackageJsonType>
16
+ <PackageJsonMain Condition="$(PackageJsonMain) == ''">public-api.ts</PackageJsonMain>
17
+ <PackageJsonScriptsNg Condition="$(PackageJsonScriptsNg) == ''">ng</PackageJsonScriptsNg>
18
+ <PackageJsonScriptsStart Condition="$(PackageJsonScriptsStart) == ''">ng serve</PackageJsonScriptsStart>
19
+ <PackageJsonScriptsBuild Condition="$(PackageJsonScriptsBuild) == ''">ng build</PackageJsonScriptsBuild>
20
+ <PackageJsonScriptsWatch Condition="$(PackageJsonScriptsWatch) == ''">ng build --watch --configuration development</PackageJsonScriptsWatch>
21
+ <PackageJsonScriptsTest Condition="$(PackageJsonScriptsTest) == ''">ng test</PackageJsonScriptsTest>
22
+ <PackageJsonDependenciesAngularAnimations Condition="$(PackageJsonDependenciesAngularAnimations) == ''">^20.3.18</PackageJsonDependenciesAngularAnimations>
23
+ <PackageJsonDependenciesAngularCdk Condition="$(PackageJsonDependenciesAngularCdk) == ''">^20.2.14</PackageJsonDependenciesAngularCdk>
24
+ <PackageJsonDependenciesAngularCommon Condition="$(PackageJsonDependenciesAngularCommon) == ''">^20.3.18</PackageJsonDependenciesAngularCommon>
25
+ <PackageJsonDependenciesAngularCompiler Condition="$(PackageJsonDependenciesAngularCompiler) == ''">^20.3.18</PackageJsonDependenciesAngularCompiler>
26
+ <PackageJsonDependenciesAngularCore Condition="$(PackageJsonDependenciesAngularCore) == ''">^20.3.18</PackageJsonDependenciesAngularCore>
27
+ <PackageJsonDependenciesAngularForms Condition="$(PackageJsonDependenciesAngularForms) == ''">^20.3.18</PackageJsonDependenciesAngularForms>
28
+ <PackageJsonDependenciesAngularPlatformBrowser Condition="$(PackageJsonDependenciesAngularPlatformBrowser) == ''">^20.3.18</PackageJsonDependenciesAngularPlatformBrowser>
29
+ <PackageJsonDependenciesAngularPlatformBrowserDynamic Condition="$(PackageJsonDependenciesAngularPlatformBrowserDynamic) == ''">^20.3.18</PackageJsonDependenciesAngularPlatformBrowserDynamic>
30
+ <PackageJsonDependenciesAngularOauth2Oidc Condition="$(PackageJsonDependenciesAngularOauth2Oidc) == ''">^20.0.2</PackageJsonDependenciesAngularOauth2Oidc>
31
+ <PackageJsonDependenciesAngularOauth2OidcJwks Condition="$(PackageJsonDependenciesAngularOauth2OidcJwks) == ''">^20.0.0</PackageJsonDependenciesAngularOauth2OidcJwks>
32
+ <PackageJsonDependenciesAngularRouter Condition="$(PackageJsonDependenciesAngularRouter) == ''">^20.3.18</PackageJsonDependenciesAngularRouter>
33
+ <PackageJsonDependenciesPrimengThemes Condition="$(PackageJsonDependenciesPrimengThemes) == ''">^21.0.2</PackageJsonDependenciesPrimengThemes>
34
+ <PackageJsonDependenciesPrimeicons Condition="$(PackageJsonDependenciesPrimeicons) == ''">^7.0.0</PackageJsonDependenciesPrimeicons>
35
+ <PackageJsonDependenciesPrimeng Condition="$(PackageJsonDependenciesPrimeng) == ''">^20.4.0</PackageJsonDependenciesPrimeng>
36
+ <PackageJsonDependenciesRxjs Condition="$(PackageJsonDependenciesRxjs) == ''">~7.8.0</PackageJsonDependenciesRxjs>
37
+ <PackageJsonDependenciesTslib Condition="$(PackageJsonDependenciesTslib) == ''">^2.3.0</PackageJsonDependenciesTslib>
38
+ <PackageJsonDependenciesZoneJs Condition="$(PackageJsonDependenciesZoneJs) == ''">~0.15.0</PackageJsonDependenciesZoneJs>
39
+ <PackageJsonDevdependenciesAngularBuild Condition="$(PackageJsonDevdependenciesAngularBuild) == ''">^20.3.20</PackageJsonDevdependenciesAngularBuild>
40
+ <PackageJsonDevdependenciesAngularCli Condition="$(PackageJsonDevdependenciesAngularCli) == ''">^20.3.20</PackageJsonDevdependenciesAngularCli>
41
+ <PackageJsonDevdependenciesAngularCompilerCli Condition="$(PackageJsonDevdependenciesAngularCompilerCli) == ''">^20.3.18</PackageJsonDevdependenciesAngularCompilerCli>
42
+ <PackageJsonDevdependenciesTypesJasmine Condition="$(PackageJsonDevdependenciesTypesJasmine) == ''">~5.1.0</PackageJsonDevdependenciesTypesJasmine>
43
+ <PackageJsonDevdependenciesJasmineCore Condition="$(PackageJsonDevdependenciesJasmineCore) == ''">~5.6.0</PackageJsonDevdependenciesJasmineCore>
44
+ <PackageJsonDevdependenciesKarma Condition="$(PackageJsonDevdependenciesKarma) == ''">~6.4.0</PackageJsonDevdependenciesKarma>
45
+ <PackageJsonDevdependenciesKarmaChromeLauncher Condition="$(PackageJsonDevdependenciesKarmaChromeLauncher) == ''">~3.2.0</PackageJsonDevdependenciesKarmaChromeLauncher>
46
+ <PackageJsonDevdependenciesKarmaCoverage Condition="$(PackageJsonDevdependenciesKarmaCoverage) == ''">~2.2.0</PackageJsonDevdependenciesKarmaCoverage>
47
+ <PackageJsonDevdependenciesKarmaJasmine Condition="$(PackageJsonDevdependenciesKarmaJasmine) == ''">~5.1.0</PackageJsonDevdependenciesKarmaJasmine>
48
+ <PackageJsonDevdependenciesKarmaJasmineHtmlReporter Condition="$(PackageJsonDevdependenciesKarmaJasmineHtmlReporter) == ''">~2.1.0</PackageJsonDevdependenciesKarmaJasmineHtmlReporter>
49
+ <PackageJsonDevdependenciesNgPackagr Condition="$(PackageJsonDevdependenciesNgPackagr) == ''">^20.3.2</PackageJsonDevdependenciesNgPackagr>
50
+ <PackageJsonDevdependenciesTypescript Condition="$(PackageJsonDevdependenciesTypescript) == ''">~5.9.3</PackageJsonDevdependenciesTypescript>
51
+ </PropertyGroup>
52
+ </Project>
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@bcweed/authentication-lib",
3
+ "version": "0.0.0",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "description": "This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.19.",
9
+ "homepage": "https://github.com/cartier966/AngularAuthenticationLibrary#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/cartier966/AngularAuthenticationLibrary/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/cartier966/AngularAuthenticationLibrary.git"
16
+ },
17
+ "license": "ISC",
18
+ "author": "",
19
+ "type": "commonjs",
20
+ "main": "public-api.ts",
21
+ "scripts": {
22
+ "ng": "ng",
23
+ "start": "ng serve",
24
+ "build": "ng build",
25
+ "watch": "ng build --watch --configuration development",
26
+ "test": "ng test"
27
+ },
28
+ "dependencies": {
29
+ "@angular/animations": "^20.3.18",
30
+ "@angular/cdk": "^20.2.14",
31
+ "@angular/common": "^20.3.18",
32
+ "@angular/compiler": "^20.3.18",
33
+ "@angular/core": "^20.3.18",
34
+ "@angular/forms": "^20.3.18",
35
+ "@angular/platform-browser": "^20.3.18",
36
+ "@angular/platform-browser-dynamic": "^20.3.18",
37
+ "angular-oauth2-oidc": "^20.0.2",
38
+ "angular-oauth2-oidc-jwks": "^20.0.0",
39
+ "@angular/router": "^20.3.18",
40
+ "@primeng/themes": "^21.0.2",
41
+ "primeicons": "^7.0.0",
42
+ "primeng": "^20.4.0",
43
+ "rxjs": "~7.8.0",
44
+ "tslib": "^2.3.0",
45
+ "zone.js": "~0.15.0"
46
+ },
47
+ "devDependencies": {
48
+ "@angular/build": "^20.3.20",
49
+ "@angular/cli": "^20.3.20",
50
+ "@angular/compiler-cli": "^20.3.18",
51
+ "@types/jasmine": "~5.1.0",
52
+ "jasmine-core": "~5.6.0",
53
+ "karma": "~6.4.0",
54
+ "karma-chrome-launcher": "~3.2.0",
55
+ "karma-coverage": "~2.2.0",
56
+ "karma-jasmine": "~5.1.0",
57
+ "karma-jasmine-html-reporter": "~2.1.0",
58
+ "ng-packagr": "^20.3.2",
59
+ "typescript": "~5.9.3"
60
+ }
61
+ }
@@ -0,0 +1,63 @@
1
+ # AuthenticationLib
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build authentication-lib
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/authentication-lib
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/authentication-lib",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "authentication-lib",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/animations": "^20.3.18",
6
+ "@angular/cdk": "^20.2.14",
7
+ "@angular/common": "^20.3.18",
8
+ "@angular/compiler": "^20.3.18",
9
+ "@angular/core": "^20.3.18",
10
+ "@angular/forms": "^20.3.18",
11
+ "@angular/platform-browser": "^20.3.18",
12
+ "@angular/platform-browser-dynamic": "^20.3.18",
13
+ "angular-oauth2-oidc": "^20.0.2",
14
+ "angular-oauth2-oidc-jwks": "^20.0.0",
15
+ "@angular/router": "^20.3.18",
16
+ "@primeng/themes": "^21.0.2",
17
+ "primeicons": "^7.0.0",
18
+ "primeng": "^20.4.0",
19
+ "rxjs": "~7.8.0",
20
+ "tslib": "^2.3.0",
21
+ "zone.js": "~0.15.0"
22
+ },
23
+ "dependencies": {
24
+ "tslib": "^2.3.0"
25
+ },
26
+ "sideEffects": false
27
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { AuthCallbackComponent } from './auth-callback.component';
4
+
5
+ describe('AuthCallbackComponent', () => {
6
+ let component: AuthCallbackComponent;
7
+ let fixture: ComponentFixture<AuthCallbackComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [AuthCallbackComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(AuthCallbackComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,68 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { OAuthEvent } from 'angular-oauth2-oidc';
3
+ import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
4
+ import { AuthService } from '../auth.service';
5
+ @Component({
6
+ selector: 'app-auth-callback',
7
+ standalone: false,
8
+ templateUrl: './auth-callback.component.html',
9
+ styleUrl: './auth-callback.component.scss'
10
+ })
11
+ export class AuthCallbackComponent implements OnInit {
12
+ constructor(private router: Router, private activatedRoute: ActivatedRoute, private authService: AuthService) { }
13
+
14
+ ngOnInit(): void {
15
+ if (this.activatedRoute.snapshot.queryParams['error']) {
16
+ // this.authService.createAndSaveNonce();
17
+ this.authService.events$.subscribe((event: OAuthEvent) => {
18
+ if (event.type === 'code_error' && this.authService.state()) {
19
+ // Read and decode the original return URL from the state property
20
+ const redirectUrl = decodeURIComponent(this.authService.state()!);
21
+
22
+ // Redirect the user to the intended page
23
+ if (redirectUrl && redirectUrl !== '/') {
24
+ this.reRouteToError(redirectUrl);
25
+ }
26
+ }
27
+ });
28
+ const state = this.authService.state();
29
+ if (state && state !== undefined) {
30
+ const redirectUrl = decodeURIComponent(state);
31
+ if (redirectUrl && redirectUrl !== '/') {
32
+ this.reRouteToError(redirectUrl);
33
+ }
34
+ else {
35
+ this.reRouteToError('/');
36
+
37
+ }
38
+ }
39
+ }
40
+ else {
41
+ this.authService.events$.subscribe((event: OAuthEvent) => {
42
+ if (event.type === 'token_received' && this.authService.state()) {
43
+ // Read and decode the original return URL from the state property
44
+ const redirectUrl = decodeURIComponent(this.authService.state()!);
45
+
46
+ // Redirect the user to the intended page
47
+ if (redirectUrl && redirectUrl !== '/') {
48
+ console.log('Redirecting to initially requested page:', redirectUrl);
49
+ this.router.navigateByUrl(redirectUrl);
50
+ }
51
+ else {
52
+ this.router.navigate(['/home']);
53
+ }
54
+ }
55
+ });
56
+ }
57
+
58
+ }
59
+ private reRouteToError(redirectUrl:string): void {
60
+ const navigationExtras: NavigationExtras = {
61
+ queryParams: {
62
+ returnUrl: redirectUrl
63
+ }
64
+ };
65
+ this.router.navigate(['/authentication-error'], navigationExtras);
66
+ }
67
+ }
68
+
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { AuthService } from './auth.service';
4
+
5
+ describe('AuthService', () => {
6
+ let service: AuthService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(AuthService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });