From bee3e1535e1eca099fe3db78cf014ccdf2e3b293 Mon Sep 17 00:00:00 2001 From: Andrey Rusakov Date: Mon, 23 Sep 2024 15:57:14 +0200 Subject: [PATCH] Removed force token update button --- package-lock.json | 17 +++++++++++++++++ package.json | 3 ++- src/app/app.component.html | 3 --- src/app/app.component.ts | 8 -------- src/app/auth/oidc-auth-config.module.ts | 2 +- src/app/auth/oidc/oidc.component.ts | 4 ++-- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index e29c1a4..f900102 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "@ngrx/store": "^16.2.0", "angular-auth-oidc-client": "18.0.1", "angular-split": "^16.2.1", + "jasmine-spec-reporter": "^7.0.0", "lodash-es": "^4.17.21", "ol": "^8.1.0", "ol-ext": "^4.0.11", @@ -6904,6 +6905,14 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -10356,6 +10365,14 @@ "integrity": "sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==", "dev": true }, + "node_modules/jasmine-spec-reporter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-7.0.0.tgz", + "integrity": "sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==", + "dependencies": { + "colors": "1.4.0" + } + }, "node_modules/jasmine/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/package.json b/package.json index 7597368..7397c98 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@ngrx/store": "^16.2.0", "angular-auth-oidc-client": "18.0.1", "angular-split": "^16.2.1", + "jasmine-spec-reporter": "^7.0.0", "lodash-es": "^4.17.21", "ol": "^8.1.0", "ol-ext": "^4.0.11", @@ -60,4 +61,4 @@ "tslint": "~6.1.0", "typescript": "~5.1.6" } -} \ No newline at end of file +} diff --git a/src/app/app.component.html b/src/app/app.component.html index aef23da..2dd7337 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -8,9 +8,6 @@
- - - diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8805e9b..01b3a4c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -55,14 +55,6 @@ export class AppComponent implements OnDestroy { }); } - forceTokenRefresh() { - this.store.select(getUser).subscribe(user => { - if (user && user.tokenRefresh) { - this.store.dispatch(fromAuth.refreshToken({ token: user.tokenRefresh })); - } - }); - } - ngOnDestroy() { if (this.refreshTokenInterval) { clearInterval(this.refreshTokenInterval); diff --git a/src/app/auth/oidc-auth-config.module.ts b/src/app/auth/oidc-auth-config.module.ts index 1121834..8c46fdd 100644 --- a/src/app/auth/oidc-auth-config.module.ts +++ b/src/app/auth/oidc-auth-config.module.ts @@ -5,7 +5,7 @@ import { ConfigService } from '../_services/config.service'; const authFactory = (configService: ConfigService) => { const config = configService.config; - return new StsConfigStaticLoader(config!.oidcConfig); + return config?.oidcConfig ? new StsConfigStaticLoader(config.oidcConfig) : []; }; @NgModule({ diff --git a/src/app/auth/oidc/oidc.component.ts b/src/app/auth/oidc/oidc.component.ts index 1778971..206555a 100644 --- a/src/app/auth/oidc/oidc.component.ts +++ b/src/app/auth/oidc/oidc.component.ts @@ -1,6 +1,6 @@ -import { Component, HostBinding, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; -import { LoginResponse, OidcSecurityService } from 'angular-auth-oidc-client'; +import { OidcSecurityService } from 'angular-auth-oidc-client'; import { AppState } from 'src/app/_store'; import * as AuthActions from '../../_store/auth/auth.action';