MCPcopy
hub / github.com/freeCodeCamp/freeCodeCamp / getCSRFToken

Function getCSRFToken

client/src/utils/ajax.ts:28–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26// csrf_token is passed to the client as a cookie. The client must send
27// this back as a header.
28function getCSRFToken() {
29 const token =
30 typeof window !== 'undefined' ? cookies.get('csrf_token') : null;
31 return token ?? '';
32}
33
34export interface ResponseWithData<T> {
35 response: Response;

Callers 3

getFunction · 0.85
requestFunction · 0.85
prepareHeadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected