Various AT Protocol integrations with obsidian
20
fork

Configure Feed

Select the types of activity you want to include in your feed.

better html page

+22 -8
+22 -8
oauth-callback.html
··· 107 107 <script> 108 108 (function() { 109 109 try { 110 - // Extract OAuth parameters from URL hash (not search string) 111 - // OAuth providers redirect with params in the hash fragment 110 + // extract OAuth parameters from URL hash (not search string) 112 111 const params = new URLSearchParams(window.location.hash.slice(1)); 113 112 114 - // Build Obsidian URI with all OAuth callback parameters 115 113 const obsidianUri = `obsidian://atmosphere-oauth?${params.toString()}`; 116 114 117 - // Store the URI for manual copy 115 + // store the URI for manual copy 118 116 document.getElementById('link-text').textContent = obsidianUri; 119 117 120 - // Attempt automatic redirect 121 118 window.location.href = obsidianUri; 122 119 123 - // Show manual instructions after a delay if redirect didn't work 124 120 setTimeout(function() { 125 - document.getElementById('status').textContent = 'Having trouble redirecting?'; 121 + const spinner = document.querySelector('.spinner'); 122 + if (spinner) spinner.style.display = 'none'; 123 + 124 + // Show success message 125 + document.querySelector('h1').textContent = '✅ Redirected!'; 126 + document.getElementById('status').textContent = 'Return to Obsidian to complete login.'; 127 + 128 + setTimeout(function() { 129 + try { 130 + window.close(); 131 + } catch (e) { 132 + document.getElementById('status').textContent = 'You can close this window now.'; 133 + } 134 + }, 500); 135 + }, 500); 136 + 137 + // show manual instructions after a longer delay if still open 138 + setTimeout(function() { 126 139 document.getElementById('manual-link').classList.add('show'); 127 - }, 2000); 140 + }, 3000); 128 141 129 142 } catch (error) { 130 143 console.error('Redirect error:', error); 144 + document.querySelector('.spinner').style.display = 'none'; 131 145 document.getElementById('status').textContent = 'An error occurred during redirect'; 132 146 document.getElementById('manual-link').classList.add('show'); 133 147 }