(setCookies: string[])
| 27 | }; |
| 28 | |
| 29 | export 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 | |
| 37 | const ORIGIN = 'https://www.freecodecamp.org'; |
| 38 |
no outgoing calls
no test coverage detected