This commit is contained in:
vxclutch
2026-05-27 18:52:37 -04:00
parent 6da1bb9fc1
commit 7ee19a2883
3 changed files with 55 additions and 25 deletions

View File

@@ -1,20 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lash v{{.Version}}</title>
</head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lash v{{.Version}}</title>
</head>
<body>
</body>
<body>
<h1>Enter Token</h1>
<script>
await fetch('/api/receive-token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token: "foo" })
});
</script>
<input
type="text"
id="tokenInput"
placeholder="Enter token"
/>
<button id="submitBtn">
Submit
</button>
<p id="status"></p>
<script>
const tokenInput = document.getElementById('tokenInput');
const submitBtn = document.getElementById('submitBtn');
const status = document.getElementById('status');
submitBtn.addEventListener('click', async () => {
const token = tokenInput.value.trim();
if (!token) {
status.textContent = 'Please enter a token.';
return;
}
const response = await fetch('/api/receive-token', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ token })
});
});
</script>
</body>
</html>