X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e57a8f466cdbaec06d35639cc54241600a6b54e7..1d4e548cf6c8f11d939712ea5f4df06786a89d64:/src/services/auth-service/auth-service.ts diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts index 5e382fba..75101711 100644 --- a/src/services/auth-service/auth-service.ts +++ b/src/services/auth-service/auth-service.ts @@ -69,6 +69,10 @@ export class AuthService { return this.getStorage().getItem(HOME_CLUSTER) || undefined; } + public getApiClient() { + return this.apiClient; + } + public removeUser() { this.getStorage().removeItem(USER_EMAIL_KEY); this.getStorage().removeItem(USER_FIRST_NAME_KEY); @@ -92,7 +96,7 @@ export class AuthService { window.location.assign(`${this.baseUrl || ""}/logout?return_to=${currentUrl}`); } - public getUserDetails = (): Promise => { + public getUserDetails = (showErrors?: boolean): Promise => { const reqId = uuid(); this.actions.progressFn(reqId, true); return this.apiClient @@ -114,7 +118,7 @@ export class AuthService { }) .catch(e => { this.actions.progressFn(reqId, false); - this.actions.errorFn(reqId, e); + this.actions.errorFn(reqId, e, showErrors); throw e; }); } @@ -141,8 +145,9 @@ export class AuthService { clusterId: cfg.uuidPrefix, remoteHost: cfg.rootUrl, baseUrl: cfg.baseUrl, - name: user ? getUserDisplayName(user): '', + name: user ? getUserDisplayName(user) : '', email: user ? user.email : '', + userIsActive: user ? user.isActive : false, token: this.getApiToken(), loggedIn: true, active: true,