Skip to content
Snippets Groups Projects
Commit c9808a23 authored by Mathias Myhrvold Olsen's avatar Mathias Myhrvold Olsen
Browse files

index.html now has a password field and the index.js file also sends the...

index.html now has a password field and the index.js file also sends the password as well as the username
parent 286edb7e
No related branches found
No related tags found
No related merge requests found
Pipeline #114926 passed
......@@ -15,6 +15,7 @@
</div>
<form class="main" id="loginForm" onsubmit="login(event)">
<input class="loginInput" placeholder="Brukernavn..." id="username" required pattern="([\w]+)">
<input class="loginInput" type="password" placeholder="Passord..." id="password" required pattern="([\w]+)">
<button class="loginBtn">Logg inn</button>
</form>
</div>
......
......@@ -15,7 +15,8 @@ inputfield.addEventListener("input",function () {
function login(event){
event.preventDefault();
let user = {
"username": document.getElementById('username').value
"username": document.getElementById('username').value,
"password": document.getElementById('password').value
};
fetch('../api/user', {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment