MCPcopy
hub / github.com/freeCodeCamp/freeCodeCamp / getCsrfToken

Function getCsrfToken

api/vitest.utils.ts:29–35  ·  view source on GitHub ↗
(setCookies: string[])

Source from the content-addressed store, hash-verified

27};
28
29export const getCsrfToken = (setCookies: string[]): string | undefined => {
30 const csrfSetCookie = setCookies.find(str => str.includes(CSRF_COOKIE));
31 const [csrfCookie] = csrfSetCookie?.split(';') ?? [];
32 const [_key, csrfToken] = csrfCookie?.split('=') ?? [];
33
34 return csrfToken;
35};
36
37const ORIGIN = 'https://www.freecodecamp.org';
38

Callers 2

superRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected