Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

596 B
Raw Blame
import type { AxiosInstance } from "axios";
import { getAccessToken } from "@editor/auth/session";

/** SaaS auth headers for raw fetch() calls — access token from current session. */
export async function getAuthHeaders(): Promise<Record<string, string>> {
  const headers: Record<string, string> = {};
  const token = await getAccessToken();
  if (token) {
    headers["Authorization"] = `Bearer ${token}`;
  }
  return headers;
}

/** No-op: SaaS apiClient wires its own interceptors (see saas/services/apiClient.ts). */
export function setupApiInterceptors(_client: AxiosInstance): void {}