// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ const csrfTokenMetaElement: Maybe = document.querySelector( 'meta[name="csrf-token"]', ) const initialCsrfToken = csrfTokenMetaElement ? csrfTokenMetaElement.getAttribute('content') : null let csrfToken: Maybe = null export const setCSRFToken = (newCSRFToken: string) => { csrfToken = newCSRFToken } export const getCSRFToken = (): Maybe => { return csrfToken || initialCsrfToken }