diff --git a/aio/gulp/conf.js b/aio/gulp/conf.js index 5639e5cd2b01..c46cc2878745 100644 --- a/aio/gulp/conf.js +++ b/aio/gulp/conf.js @@ -214,13 +214,18 @@ export default { enableSkipButton: argv.enableSkipButton !== undefined ? argv.enableSkipButton : false, - /** * Allows to enable login view when serving on http. */ enableInsecureLogin: argv.enableInsecureLogin !== undefined ? argv.enableInsecureLogin : false, + /** + * Defines token time to live. + */ + tokenTTL: argv.tokenTTL !== undefined ? + argv.tokenTTL : + 0, }, /** diff --git a/aio/gulp/serve.js b/aio/gulp/serve.js index b72bf2f3c476..f0b0ce62c660 100644 --- a/aio/gulp/serve.js +++ b/aio/gulp/serve.js @@ -60,6 +60,10 @@ function getBackendArgs() { args.push(`--apiserver-host=${conf.backend.apiServerHost}`); } + if(conf.backend.tokenTTL) { + args.push(`--token-ttl=${conf.backend.tokenTTL}`); + } + return args; } diff --git a/src/app/frontend/common/components/breadcrumbs/component.ts b/src/app/frontend/common/components/breadcrumbs/component.ts index dd142a43533f..f5b6eb39daf1 100644 --- a/src/app/frontend/common/components/breadcrumbs/component.ts +++ b/src/app/frontend/common/components/breadcrumbs/component.ts @@ -52,9 +52,10 @@ export class BreadcrumbsComponent implements OnInit { const currentRoute = this._getCurrentRoute(); const url = this._router.url.includes('?') ? this._router.url.split('?')[0] : ''; let urlArray = url.split('/'); - let routeParamsCount = currentRoute.routeConfig.data.routeParamsCount - ? +currentRoute.routeConfig.data.routeParamsCount - : currentRoute.routeConfig.path.split('/').length; + let routeParamsCount = + currentRoute.routeConfig.data && currentRoute.routeConfig.data.routeParamsCount + ? +currentRoute.routeConfig.data.routeParamsCount + : currentRoute.routeConfig.path.split('/').length; this.breadcrumbs = [ { diff --git a/src/app/frontend/error/handler.ts b/src/app/frontend/error/handler.ts index 147c4d1f3dac..8520f82119cc 100644 --- a/src/app/frontend/error/handler.ts +++ b/src/app/frontend/error/handler.ts @@ -49,10 +49,10 @@ export class GlobalErrorHandler implements ErrorHandler { private handleHTTPError_(error: HttpErrorResponse): void { this.ngZone_.run(() => { if (KdError.isError(error, ApiError.tokenExpired, ApiError.encryptionKeyChanged)) { + this.auth_.removeAuthCookies(); this.router_.navigate(['login'], { state: {error: AsKdError(error)} as StateError, }); - this.auth_.removeAuthCookies(); return; }