initial commit

This commit is contained in:
Mystikfluu
2022-04-20 21:31:09 +02:00
commit 534d1a6d07
11 changed files with 2217 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<head>
<style media="screen">
a {
color: red;
text-decoration: none;
}
</style>
<link rel="stylesheet" href="/css/main.css">
</head>
<body>
<header>
<h1>Auth website</h1>
</header>
<main>
<div class="info_div">
<p>Do you not have an account? <a href="register">Register now!</a></p>
<br>
<br>
<p>Do you already have an account? <a href="login">Login now!</a></p>
</div>
</main>
<footer>
</footer>
</body>
+32
View File
@@ -0,0 +1,32 @@
<head>
<link rel="stylesheet" href="/css/logon.css">
<script type="text/javascript">
function login() {
const user = document.getElementById("user").value
const pw = document.getElementById("pass").value
}
</script>
</head>
<body>
<header>
<h1>Login</h1>
</header>
<main>
<form id="login_form" class="form_class" action="login" method="post">
<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>
</div>
<div class="info_div">
<p>Do you not have an account? <a href="register">Register now!</a></p>
</div>
</form>
</main>
<footer>
</footer>
</body>
+32
View File
@@ -0,0 +1,32 @@
<head>
<link rel="stylesheet" href="/css/logon.css">
<script type="text/javascript">
function register() {
const user = document.getElementById("user").value
const pw = document.getElementById("pass").value
}
</script>
</head>
<body>
<header>
<h1>Register</h1>
</header>
<main>
<form id="register_form" class="form_class" action="register" method="post">
<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="register_form" onclick="return register()">register</button>
</div>
<div class="info_div">
<p>Do you already have an account? <a href="/login">Login now!</a></p>
</div>
</form>
</main>
<footer>
</footer>
</body>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logged In</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body onload="setuser()">
<h1>Welcome Back!</h1>
<h2 id="user">User: USER</h2>
<button onclick="location.assign('/')">To Login Page</button><button onclick="location.assign('/register')">To Register Page</button>
<script>
async function setuser() {
let user = await (await fetch("/api/getuser")).json();
let username
username = user["username"];
if(user["error"])username=user["error"];
document.getElementById("user").innerText = `User: ${username}`;
}
</script>
</body>
</html>