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

16 lines
410 B
TypeScript
Raw Normal View History

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