Refactor data-explorer to make it background more customizable, add slot for custom...
[arvados-workbench2.git] / src / services / auth-service / auth-service.ts
index 6faaf99ee7a37109a93021cd9cafeb31c4fa57a3..22c9dcd6ae3e36e495f25a9e152f9a489506efdc 100644 (file)
@@ -2,9 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { User, userPrefs } from "~/models/user";
+import { User, UserPrefs } from "~/models/user";
 import { AxiosInstance } from "axios";
-import { ApiActions, ProgressFn } from "~/services/api/api-actions";
+import { ApiActions } from "~/services/api/api-actions";
 import * as uuid from "uuid/v4";
 
 export const API_TOKEN_KEY = 'apiToken';
@@ -25,7 +25,7 @@ export interface UserDetailsResponse {
     owner_uuid: string;
     is_admin: boolean;
     identity_url: string;
-    prefs: userPrefs;
+    prefs: UserPrefs;
 }
 
 export class AuthService {
@@ -56,7 +56,7 @@ export class AuthService {
     }
 
     public getIsAdmin(): boolean {
-        return !!localStorage.getItem(USER_IS_ADMIN);
+        return localStorage.getItem(USER_IS_ADMIN) === 'true';
     }
 
     public getUser(): User | undefined {
@@ -114,7 +114,6 @@ export class AuthService {
             .then(resp => {
                 this.actions.progressFn(reqId, false);
                 const prefs = resp.data.prefs.profile ? resp.data.prefs : { profile: {}};
-                console.log(resp.data);
                 return {
                     email: resp.data.email,
                     firstName: resp.data.first_name,