formatting

This commit is contained in:
Ean Milligan
2026-04-10 16:03:11 -04:00
parent 86cda618a9
commit 44bbb6e719

View File

@@ -1,10 +1,9 @@
export default `<div>
<script>
function doLogin(){
fetch('/api/auth', {
method:'POST',
body:JSON.stringify({ name:document.getElementById('name').value.trim(), pin:document.getElementById('pin').value.trim() })
}).catch((e)=>{e.text().then((text)=>{alert(text);});}).then((r) => {
fetch('/api/auth',{method:'POST',body:JSON.stringify({ name:document.getElementById('name').value.trim(), pin:document.getElementById('pin').value.trim() })})
.catch((e)=>{e.text().then((text)=>{alert(text);});})
.then((r) => {
if(r.status===200){r.json().then((j)=>{localStorage.setItem('name', document.getElementById('name').value.trim());window.location.replace('/api/home/'+j.id);});}
else{r.text().then((text)=>{alert(text);});}
});