adlerka.top/templates/login.html

87 lines
3.3 KiB
HTML
Raw Normal View History

2024-02-03 16:08:26 +01:00
<script>
function login() {
2024-02-03 18:06:15 +01:00
const email = document.getElementById("login_email").value;
const password = document.getElementById("login_password").value;
2024-02-03 16:08:26 +01:00
doLogin(email, password);
}
function doLogin(email, password) {
const data = new URLSearchParams();
data.append("action", "login");
data.append("email", email);
data.append("password", password);
2024-02-03 17:01:52 +01:00
doAccountAction(data, "Login Successful!", "Login failed. Please check your credentials.");
2024-02-03 16:08:26 +01:00
}
2024-02-03 18:06:15 +01:00
function register() {
const firstName = document.getElementById("register_firstName").value;
const lastName = document.getElementById("register_lastName").value;
const nickname = document.getElementById("register_nickname").value;
const email = document.getElementById("register_email").value;
const password = document.getElementById("register_password").value;
const minecraftNick = document.getElementById("register_minecraftNick").value;
const activationToken = document.getElementById("register_activationToken").value;
const data = new URLSearchParams();
data.append("action", "register");
data.append("firstname", firstName);
data.append("lastname", lastName);
data.append("nickname", nickname);
data.append("email", email);
data.append("password", password);
data.append("minecraft_nick", minecraftNick);
data.append("activation_token", activationToken);
doRegister(data);
}
function doRegister(requestData) {
doAccountAction(requestData, "Registration Successful!", "Registration failed.");
}
2024-02-03 16:08:26 +01:00
</script>
2024-02-03 18:06:15 +01:00
<!-- Centralized Status Message -->
<p id="StatusMessage"></p>
2024-02-03 16:08:26 +01:00
<div class="form-container" id="loginForm">
<h1>Login</h1>
2024-02-03 16:08:26 +01:00
<form>
2024-02-03 18:06:15 +01:00
<label for="login_email">Email:</label>
<input type="text" id="login_email" name="email" required><br>
2024-02-03 18:06:15 +01:00
<label for="login_password">Password:</label>
<input type="password" id="login_password" name="password" required><br>
<button type="button" onclick="login()">Login</button>
2024-02-03 18:06:15 +01:00
</form><hr>
2024-02-03 16:08:26 +01:00
</div>
2024-02-03 18:06:15 +01:00
<div class="form-container" id="register_Form">
<h1>Register</h1>
<form>
<label for="register_firstName">First Name:</label>
<input type="text" id="register_firstName" name="firstName" required><br>
<label for="register_lastName">Last Name:</label>
<input type="text" id="register_lastName" name="lastName" required><br>
<label for="register_nickname">Nickname:</label>
<input type="text" id="register_nickname" name="nickname" required><br>
<label for="register_email">Email:</label>
<input type="text" id="register_email" name="email" required><br>
<label for="register_password">Password:</label>
<input type="password" id="register_password" name="password" required><br>
<label for="register_minecraftNick">Minecraft Nick:</label>
<input type="text" id="register_minecraftNick" name="minecraftNick" required><br>
<label for="register_activationToken">Activation Token:</label>
<input type="text" id="register_activationToken" name="activationToken" required><br>
<button type="button" onclick="register()">Register</button>
</form>
</div>