heymoosh_ticktick-quick-add.../index.html

36 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2025-04-13 20:18:30 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TickTick OAuth Callback</title>
</head>
<body>
<h1>Authorization Complete</h1>
<p id="message">Processing...</p>
<p id="fallback" style="display:none">
If Obsidian did not open automatically,
<a id="deeplink" href="#">tap here to return to Obsidian</a>.
</p>
2025-04-13 20:18:30 +00:00
<script>
const params = new URLSearchParams(window.location.search);
const code = params.get('code');
const state = params.get('state');
const messageEl = document.getElementById('message');
2025-04-13 20:18:30 +00:00
if (code && state) {
const target = 'obsidian://ticktick-callback'
+ '?code=' + encodeURIComponent(code)
+ '&state=' + encodeURIComponent(state);
messageEl.innerText = 'Returning you to Obsidian…';
const fallback = document.getElementById('fallback');
const link = document.getElementById('deeplink');
link.href = target;
fallback.style.display = 'block';
window.location.replace(target);
2025-04-13 20:18:30 +00:00
} else {
messageEl.innerText = 'Authorization failed or was canceled. Please try again.';
2025-04-13 20:18:30 +00:00
}
</script>
</body>
</html>