You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/11/13 14:04:49 UTC

[incubator-dlab] branch v2.2-RC1 updated: [DLAB-1216]: fixed login redirect in case bad request error

This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch v2.2-RC1
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/v2.2-RC1 by this push:
     new feb5021  [DLAB-1216]: fixed login redirect in case bad request error
feb5021 is described below

commit feb5021cf77252834575e9cd4d39b91f17b4b792
Author: Andriana Kovalyshyn <an...@epam.com>
AuthorDate: Wed Nov 13 12:24:45 2019 +0200

    [DLAB-1216]: fixed login redirect in case bad request error
---
 .../webapp/src/app/core/interceptors/error.interceptor.ts         | 8 +++-----
 .../resources/webapp/src/app/resources/resources.component.ts     | 1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts b/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
index d464d16..e1b8039 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
@@ -47,13 +47,12 @@ import { HTTP_STATUS_CODES } from '../util';
   intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
     return next.handle(request).pipe(
       catchError(error => {
-
         if (error instanceof HttpErrorResponse) {
           switch ((<HttpErrorResponse>error).status) {
             case HTTP_STATUS_CODES.UNAUTHORIZED:
               return this.handleUnauthorized(request, next);
             case HTTP_STATUS_CODES.BAD_REQUEST:
-              return this.handleBadRequest(request, next);
+              return this.handleBadRequest(error, request, next);
             default:
               return _throw(error);
           }
@@ -70,7 +69,6 @@ import { HTTP_STATUS_CODES } from '../util';
   }
 
   private handleUnauthorized(request: HttpRequest<any>, next: HttpHandler) {
-
     if (!this.isRefreshing) {
       this.isRefreshing = true;
       this.jwtService.destroyAccessToken();
@@ -91,8 +89,8 @@ import { HTTP_STATUS_CODES } from '../util';
     }
   }
 
-  private handleBadRequest(request: HttpRequest<any>, next: HttpHandler) {
-    this.routingService.redirectToLoginPage();
+  private handleBadRequest(error, request: HttpRequest<any>, next: HttpHandler) {
+    if (!error.url.split('?')[0].endsWith('maven')) this.routingService.redirectToLoginPage();
     return next.handle(request);
   }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
index bfdcdee..a31e129 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
@@ -61,6 +61,7 @@ export class ResourcesComponent implements OnInit {
 
   public refreshGrid(): void {
     this.resourcesGrid.buildGrid();
+    this.getProjects();
     this.getEnvironmentHealthStatus();
     this.exploratoryEnvironments = this.resourcesGrid.environments;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org