// user_settings_api_keys.js — extracted from user_settings_api_keys.html
// Data injected via window.__DATA__

// Clear the new API key from session after display
(function() {
    var keyDisplay = document.querySelector('.new-key-display');
    if (keyDisplay) {
        window.addEventListener('beforeunload', function() {
            fetch('/settings/api-keys/clear-new-key', {method: 'POST', headers: {'X-CSRF-Token': window.__DATA__.csrfToken}});
        });
    }
})();