aboutsummaryrefslogtreecommitdiffstats
path: root/res/setup.html
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-03-20 23:16:01 -0700
committerPinapelz <yukais@pinapelz.com>2026-03-20 23:16:01 -0700
commit3508776583c21785dffc2f0bc9e7dd81c3f08480 (patch)
tree681272e3ec7dfaa8c2f5b1b89247aa2e7bd6acc2 /res/setup.html
parent276e12db29ab31aa002f55b1a3cc69f170c1a2c2 (diff)
init custom changes
Diffstat (limited to 'res/setup.html')
-rw-r--r--res/setup.html31
1 files changed, 12 insertions, 19 deletions
diff --git a/res/setup.html b/res/setup.html
index 8068a9d..546ee1b 100644
--- a/res/setup.html
+++ b/res/setup.html
@@ -19,17 +19,16 @@
<body>
<main class="setup">
- <h1 class="setup-title">SyncTube</h1>
- <p>Create your admin account</p>
+ <img class="welcome-image" src="img/welcome.webp" alt="Welcome to Dohee Cinema">
+ <h1 class="setup-title">Welcome to the Dohee Cinema</h1>
+ <p>put in the password for entry</p>
- <form id="setup-form" class="setup-form" action="/setup" method="POST">
- <input type="text" name="name" placeholder="Name">
+ <form id="setup-form" class="setup-form">
<input type="password" name="password" placeholder="Password">
- <input type="password" name="confirmation" placeholder="Repeat password">
<div id="form-errors" class="form-errors"></div>
- <button type="submit">Create</button>
+ <button type="submit">Enter</button>
</form>
</main>
@@ -40,30 +39,24 @@
formElement.addEventListener("submit", function (e) {
e.preventDefault();
- const { name, password, confirmation } = formElement.elements;
+ const { password } = formElement.elements;
const payload = {
- name: name.value,
password: password.value,
- passwordConfirmation: confirmation.value,
- }
+ };
- fetch("/setup", { method: "POST", body: JSON.stringify(payload) })
+ fetch("/gate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) })
.then(res => res.json())
.then(response => handleResponse(response))
.catch(() => handleResponse(null));
}, true);
-
function handleResponse(response) {
- if (response.success) {
- return window.location.reload();
+ if (response && response.success === true) {
+ window.location.href = "/";
+ return;
}
- const errors = !response
- ? ["Unknown error"]
- : (response.errors ?? []).map(item => item.error);
-
- showErrors(errorsElement, errors);
+ showErrors(errorsElement, ["Incorrect password. Not cool man"]);
}
function showErrors(container, errors) {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage