16947: Don't show misleading session validate errors.
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Oct 2020 19:53:34 +0000 (15:53 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Oct 2020 19:53:34 +0000 (15:53 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/services/auth-service/auth-service.ts
src/store/auth/auth-action-session.ts

index 5e382fba85bb129d1cff1f3d587990e468f1b63b..9fc738bc5d96549b6ea12de6859543772876a205 100644 (file)
@@ -92,7 +92,7 @@ export class AuthService {
         window.location.assign(`${this.baseUrl || ""}/logout?return_to=${currentUrl}`);
     }
 
         window.location.assign(`${this.baseUrl || ""}/logout?return_to=${currentUrl}`);
     }
 
-    public getUserDetails = (): Promise<User> => {
+    public getUserDetails = (showErrors?: boolean): Promise<User> => {
         const reqId = uuid();
         this.actions.progressFn(reqId, true);
         return this.apiClient
         const reqId = uuid();
         this.actions.progressFn(reqId, true);
         return this.apiClient
@@ -114,7 +114,7 @@ export class AuthService {
             })
             .catch(e => {
                 this.actions.progressFn(reqId, false);
             })
             .catch(e => {
                 this.actions.progressFn(reqId, false);
-                this.actions.errorFn(reqId, e);
+                this.actions.errorFn(reqId, e, showErrors);
                 throw e;
             });
     }
                 throw e;
             });
     }
index 4568d77eafb572ff1e62eff77fc5fcea4ee7a9d9..0f85e9ac5005fe5de7274d2dbe5d8526a9cfa81d 100644 (file)
@@ -114,7 +114,7 @@ export const validateCluster = async (config: Config, useToken: string):
     const svc = createServices(config, { progressFn: () => { }, errorFn: () => { } });
     setAuthorizationHeader(svc, saltedToken);
 
     const svc = createServices(config, { progressFn: () => { }, errorFn: () => { } });
     setAuthorizationHeader(svc, saltedToken);
 
-    const user = await svc.authService.getUserDetails();
+    const user = await svc.authService.getUserDetails(false);
     return {
         user,
         token: saltedToken,
     return {
         user,
         token: saltedToken,