adding validated services? patching forcad_local.py
This commit is contained in:
35
OmCTF-2025/services/bashist/static/login.html
Normal file
35
OmCTF-2025/services/bashist/static/login.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Login</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Login</h1>
|
||||
<form id="loginForm">
|
||||
<input type="text" id="username" placeholder="Username" /><br />
|
||||
<input type="password" id="password" placeholder="Password" /><br />
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
<p id="msg"></p>
|
||||
|
||||
<script>
|
||||
document
|
||||
.getElementById("loginForm")
|
||||
.addEventListener("submit", async (e) => {
|
||||
e.preventDefault();
|
||||
const res = await fetch("/api/user/login", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
username: document.getElementById("username").value,
|
||||
password: document.getElementById("password").value,
|
||||
}),
|
||||
});
|
||||
document.getElementById("msg").textContent = res.ok
|
||||
? "Logged in! Cookie set."
|
||||
: "Wrong username or password.";
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user