все скрипты для фронта страницы с формой аутентификации

This commit is contained in:
vasya
2026-03-14 20:27:12 +03:00
parent 8d1b19bfa4
commit 5c83b8717c
4 changed files with 81 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/**
* Сервис для полуения csrt токена для размещения в формах
* @date 24.07.2025
* @author dgavrilov
*/
export const getCsrfToken = ():string => {
const METATAG:HTMLElement|null = document.querySelector('meta[name="csrf-token"]');
if (!METATAG) {
return '';
}
const CSRFTOKEN:string|null = METATAG.getAttribute('content');
if (!CSRFTOKEN) {
return '';
}
return CSRFTOKEN;
}