// helpers import { API_BASE_URL } from "helpers/common.helper"; // services import { APIService } from "services/api.service"; // types import type { IUser } from "@plane/types"; interface IUserSession extends IUser { isAuthenticated: boolean; } export class UserService extends APIService { constructor() { super(API_BASE_URL); } async authCheck(): Promise { return this.get("/api/instances/admins/me/") .then((response) => ({ ...response?.data, isAuthenticated: true })) .catch(() => ({ isAuthenticated: false })); } async currentUser(): Promise { return this.get("/api/instances/admins/me/") .then((response) => response?.data) .catch((error) => { throw error?.response; }); } }