Skip to content
Snippets Groups Projects
fetchCookie.ts 286 B
import axios from 'axios';

/**
 * Call for csrf cookie. This cookie is the user session identifier and
 * must be sent during the login process.
 * @returns csrf cookie
 */
export const fetchCookie = async (): Promise<string> =>
  axios('/api/web/csrf').then((res) => res.data.token);