diff options
author | Parker <contact@pkrm.dev> | 2024-11-04 23:01:13 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-04 23:01:13 -0600 |
commit | 3f8e39cc86ca22c3e94f52d693c90553ef1dfd57 (patch) | |
tree | 0bf2ef55e3250d059f1bdaf8546f2c1f2773ad52 /app/templates | |
parent | 5a0777033f6733c33fbd6119ade812e0c749be44 (diff) |
Major consolidation and upgrades
Diffstat (limited to 'app/templates')
-rw-r--r-- | app/templates/dashboard.html | 2 | ||||
-rw-r--r-- | app/templates/login.html | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 2118fbf..f1c98e3 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -8,7 +8,7 @@ <body> <div> <!-- Create a small box that will hold the text for the users api key, next to the box should be a regenerate button --> - <p>Your API Key: <span id="api-key">{{ api_key }}</span></p> + <p>Your Username: <span id="api-key">{{ user }}</span></p> <button onclick="window.location.href='logout'">Logout</button> </div> </body> diff --git a/app/templates/login.html b/app/templates/login.html index b41d15c..1061699 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -90,19 +90,15 @@ event.preventDefault(); const formData = new FormData(this); - // Send POST request to /api/token containing form data - const response = await fetch('/api/token', { + // Send POST request to /token containing form data + const response = await fetch('/token', { method: 'POST', body: formData }); - const data = await response.json(); - if (data.response != 200) { + if (response.status != 200) { document.getElementById('error').style.display = 'block'; } else { - // Save the tokens in localStorage - window.localStorage.token = data.token; - window.localStorage.refreshToken = data.refreshToken; window.location.href = '/dashboard'; } }); |