/**
 * MSW handlers for authentication endpoints.
 * @module mocks/handlers/auth
 */
import { http, HttpResponse } from "msw";
import tokenData from "../fixtures/token.json";
import { captureRequest } from "../request-log.js";

export const authHandlers = [
  http.post("/api/oauth/token", async ({ request }) => {
    const body = await request.text();
    captureRequest("POST", "/api/oauth/token", body);
    return HttpResponse.json(tokenData);
  }),
];
