wisemapping-frontend/packages/webapp/src/utils.ts

15 lines
433 B
TypeScript
Raw Normal View History

2022-02-21 03:50:03 +01:00
export const getCsrfToken = (): string | null => {
const meta = document.head.querySelector('meta[name="_csrf"]');
if (!meta) {
return null;
}
return meta.getAttribute('content');
};
export const getCsrfTokenParameter = (): string | null => {
const meta = document.head.querySelector('meta[name="_csrf_parameter"]');
if (!meta) {
return null;
}
return meta.getAttribute('content');
};