mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 23:54:55 +01:00
16 lines
406 B
TypeScript
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');
|
|
};
|