     let currentCsrfToken = '';

        // Check if CSRF token is automatically available
        async function checkAutoToken() {
            try {
                console.log('üìû Checking auto-generated CSRF token...');
                console.log('üìû Current cookies:', document.cookie);

                // First check if token is in cookies
                const cookies = document.cookie.split(';').reduce((acc, cookie) => {
                    const [key, value] = cookie.trim().split('=')