-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
50 lines (47 loc) · 2.05 KB
/
index.html
File metadata and controls
50 lines (47 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Schwab Callback Helper</title>
<style>
body { font-family: -apple-system, Segoe UI, Roboto, sans-serif; background: #0b1220; color: #e5e7eb; margin: 0; }
.wrap { max-width: 760px; margin: 32px auto; padding: 20px; }
.card { background: #111827; border: 1px solid #374151; border-radius: 12px; padding: 16px; }
input, textarea { width: 100%; background: #0f172a; color: #e5e7eb; border: 1px solid #374151; border-radius: 8px; padding: 10px; }
button { background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 10px 14px; margin-top: 10px; cursor: pointer; }
.muted { color: #9ca3af; font-size: 13px; }
</style>
</head>
<body>
<div class="wrap">
<h2>Schwab OAuth Callback Helper</h2>
<p class="muted">Use this page as your registered callback URL in Schwab developer settings. Then copy the <code>code</code> value into your app.</p>
<div class="card">
<label>Code</label>
<input id="code" readonly />
<button id="copyCode">Copy Code</button>
<br /><br />
<label>Full Callback URL</label>
<textarea id="fullUrl" rows="4" readonly></textarea>
<button id="copyUrl">Copy Full URL</button>
</div>
</div>
<script>
const params = new URLSearchParams(window.location.search);
const code = params.get('code') || '';
const codeEl = document.getElementById('code');
const fullUrlEl = document.getElementById('fullUrl');
codeEl.value = code;
fullUrlEl.value = window.location.href;
document.getElementById('copyCode').addEventListener('click', async () => {
await navigator.clipboard.writeText(codeEl.value || '');
alert('Code copied');
});
document.getElementById('copyUrl').addEventListener('click', async () => {
await navigator.clipboard.writeText(fullUrlEl.value || '');
alert('Full URL copied');
});
</script>
</body>
</html>