Merged server and client code into single repo
This commit is contained in:
43
client/login/login.html
Normal file
43
client/login/login.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Přihlášení | Infinitum</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="http://10.69.13.199:8000/" method="post">
|
||||
<div class="most_outer_form_border">
|
||||
<div class="outer_form_border">
|
||||
<div class="form_border">
|
||||
<h1>Přihlášení</h1>
|
||||
<br>
|
||||
<label for="username">Uživatelské jméno</label>
|
||||
<br>
|
||||
<input type="text" name="username" id="username" autofocus required minlength="3" maxlength="25"/>
|
||||
<br>
|
||||
<label for="password">Heslo</label>
|
||||
<br>
|
||||
<input type="password" name="password" id="password" required minlength="8" maxlength="40" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*]).{8,}$"/>
|
||||
<br>
|
||||
<button type="submit">Přihlásit se</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
const form = document.querySelector("form");
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
const passwordInput = this.querySelector("input[type=password]");
|
||||
crypto.subtle.digest("SHA-512", new TextEncoder().encode(passwordInput.value)).then(function (hashBuffer) {
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
||||
passwordInput.value = hashHex;
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user