1document.body.addEventListener('click', function(event) { 2 const target = event.target.closest('.log_out_link a'); 3 if (target) { 4 event.preventDefault(); 5 event.stopPropagation(); 6 logOutApp(); 7 return false; 8 } 9}); 10 11async function logOutApp() { 12 const csrfToken = getLogOutCookie('csrf_token'); 13 try { 14 const response = await fetch(`${lt_accounts_config.api_url}/api/v2/users/sign_out`, { 15 method: 'DELETE', 16 headers: { 17 'csrf-token': csrfToken 18 }, 19 credentials: 'include' 20 }); 21 if (response.ok) { 22 window.location.reload(); 23 } else { 24 console.error('Log out failed:', response.statusText); 25 } 26 } catch (error) { 27 console.error('Error:', error); 28 } 29} 30 31function getLogOutCookie(name) { 32 const value = `; ${document.cookie}`; 33 const parts = value.split(`; ${name}=`); 34 if (parts.length === 2) return parts.pop().split(';').shift(); 35}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.