wisemapping-frontend/packages/webapp/src/utils.ts
2023-01-13 22:59:56 -08:00

16 lines
406 B
TypeScript

export const getCsrfToken = (): string | null => {
const meta = document.head.querySelector('meta[name="_csrf"]');
if (!meta) {
return '';
}
return meta.getAttribute('content');
};
export const getCsrfTokenParameter = (): string | null => {
const meta = document.head.querySelector('meta[name="_csrf_parameter"]');
if (!meta) {
return '';
}
return meta.getAttribute('content');
};