- fix(studio): stop markBatchDone infinite recursion so batches complete - refactor(api): merge api-response into api and drop the duplicate module - refactor(media): extract shared media loader and URL validator - refactor(ui): extract shared LoadingSpinner for site and admin groups - refactor(dates): consolidate raw date formatting into formatDate util - refactor(logs): share a single generic log-list loader across tables - refactor(theme): merge both ColorField components and reuse contrast helpers - refactor(import): extract shared ImportErrorBanner and SearchInput - chore(): remove dead theme-editor-tabs after inlining tab components
13 lines
438 B
TypeScript
13 lines
438 B
TypeScript
import { apiError, apiOk } from "@/lib/api";
|
|
import { withAdmin } from "@/lib/api-handler";
|
|
import { setCsrfCookie } from "@/lib/foundation/security";
|
|
|
|
export const GET = withAdmin({ requireCsrf: false }, async () => {
|
|
const token = await setCsrfCookie();
|
|
if (!token) return apiError("Unable to initialize CSRF token", 500);
|
|
|
|
const response = apiOk({ token });
|
|
response.headers.set("Cache-Control", "no-store");
|
|
return response;
|
|
});
|