clearer login and register errors

see #41
This commit is contained in:
Mystikfluu
2022-10-23 09:14:49 +02:00
parent 01f2888252
commit ea43f26954
4 changed files with 73 additions and 31 deletions
+8 -11
View File
@@ -4,15 +4,9 @@
<%- newrelic %>
<link rel="stylesheet" href="/css/logon.css">
<script src="/js/warn_message.js" charset="utf-8"></script>
<script type="text/javascript">
function login() {
const pw = document.getElementById("pass").value
localStorage.setItem("decryption_key",pw)
//yes I know this is not secure, but at this point I think it'd be better to trust the client for end-to-end encryption
}
</script>
<script src="/js/addnavbar.js" charset="utf-8"></script>
<link rel="stylesheet" href="/css/global.css">
<script> <%- httppostjs %> </script>
</head>
<body>
@@ -20,22 +14,25 @@
<h1>Login</h1>
</header>
<main>
<form id="login_form" class="form_class" action="login" method="post">
<div id="login_form" class="form_class">
<div class="form_div">
<label>Username:</label>
<input id="user" class="field_class" name="user" type="text" placeholder="username" autofocus required>
<label>Password:</label>
<input id="pass" class="field_class" name="pass" type="password" placeholder="password" required>
<button class="submit_class" type="submit" form="login_form" onclick="return login()">Login</button>
<input id="pass" class="field_class" name="pass" type="password" placeholder="password" required onkeydown="passkeydown(event)">
<button class="submit_class" type="submit" form="login_form" onclick="login()">Login</button>
</div>
<div class="info_div">
<p>Do you not have an account? <a href="register">Register now!</a></p>
</div>
</form>
</div>
</main>
<footer>
</footer>
<script>
<%- loadfile("./js/login.js") %>
</script>
</body>
</html>