mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-13 10:47:56 +01:00
15 lines
433 B
TypeScript
15 lines
433 B
TypeScript
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');
|
|
}; |