aboutsummaryrefslogtreecommitdiff
path: root/src/templates/login.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates/login.html')
-rw-r--r--src/templates/login.html29
1 files changed, 1 insertions, 28 deletions
diff --git a/src/templates/login.html b/src/templates/login.html
index f090108..dcf8f8e 100644
--- a/src/templates/login.html
+++ b/src/templates/login.html
@@ -2,37 +2,10 @@
<html lang="en">
<head>
- <title>Mark's Database - Login</title>
+ <title>Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="/css/styles.css">
- <script>
- let usernameEl = document.getElementById('username');
- let passwordEl = document.getElementById('password');
- function sendPost(){
- let username = usernameEl.value;
- let password = passwordEl.value;
- fetch(new Request("/login", {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify({'username':username, 'password':password})
- }))
- .then((response) => {
- console.log(response);
- window.location = "/";
- });
- }
- let onEnterEvent = function(event) {
- if (event.keyCode === 13) {
- sendPost()
- }
- }
- usernameEl.addEventListener("keyup", onEnterEvent);
- passwordEl.addEventListener("keyup", onEnterEvent);
- </script>
</head>
<body>