ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/lib/csrf-client.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/lib/csrf-client.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/lib/csrf-client.ts
Original SHA-256c203029f54b6466a0ccb82db6271e41f2e231e3bfffc8172c58cd2577c883bd9
Git blob SHA85772b669452efa9e61ae9dc600726f3aeee051d
Reading-copy SHA-256c203029f54b6466a0ccb82db6271e41f2e231e3bfffc8172c58cd2577c883bd9

Original source ↗

Recovered source transcript

'use client' const CSRF_HEADER_NAME = 'x-csrf-token' /** * Get CSRF token from meta tag for client-side usage */ export function getCSRFTokenForClient(): string { if (typeof window === 'undefined') { return '' } // Try to get from meta tag first const metaTag = document.querySelector('meta[name="csrf-token"]') if (metaTag) { return metaTag.getAttribute('content') || '' } return '' } /** * Add CSRF token to fetch requests automatically * This is the client-side version that can be used in React components */ export function fetchWithCSRF(url: string, options: RequestInit = {}): Promise<Response> { const token = getCSRFTokenForClient() if (token && !['GET', 'HEAD'].includes(options.method || 'GET')) { options.headers = { ...options.headers, [CSRF_HEADER_NAME]: token } } return fetch(url, options) }

Search equations, builds, manuscript text, and recovered sources.