Skip to content

Commit

Permalink
Removed force token update button
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov committed Sep 27, 2024
1 parent 08e5324 commit cde43ae
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -60,4 +61,4 @@
"tslint": "~6.1.0",
"typescript": "~5.1.6"
}
}
}
3 changes: 0 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@


<div class="right-container">

<button mat-raised-button (click)="forceTokenRefresh()">Force Refresh Token</button>

<button mat-icon-button [matMenuTriggerFor]="helpOverlay">
<mat-icon>contact_support</mat-icon>
</button>
Expand Down
8 changes: 0 additions & 8 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/oidc-auth-config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions src/app/auth/oidc/oidc.component.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down

0 comments on commit cde43ae

Please sign in to comment.