//
// 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';
owner_uuid: string;
is_admin: boolean;
identity_url: string;
- prefs: userPrefs;
+ prefs: UserPrefs;
}
export class AuthService {
}
public getIsAdmin(): boolean {
- return !!localStorage.getItem(USER_IS_ADMIN);
+ return localStorage.getItem(USER_IS_ADMIN) === 'true';
}
public getUser(): User | undefined {
.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,