feat: allow initial admin setup from landing page
This commit is contained in:
@@ -19,6 +19,7 @@ form.addEventListener("submit", (event) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
submit("/api/auth/login");
|
submit("/api/auth/login");
|
||||||
});
|
});
|
||||||
document
|
document.querySelector("#signup").addEventListener("click", () => {
|
||||||
.querySelector("#signup")
|
const setupToken = form.elements.setupToken.value;
|
||||||
.addEventListener("click", () => submit("/api/auth/signup"));
|
submit(setupToken ? "/api/auth/bootstrap" : "/api/auth/signup");
|
||||||
|
});
|
||||||
|
|||||||
@@ -31,6 +31,13 @@
|
|||||||
minlength="12"
|
minlength="12"
|
||||||
name="password"
|
name="password"
|
||||||
autocomplete="current-password" /></label
|
autocomplete="current-password" /></label
|
||||||
|
><label
|
||||||
|
>Initial admin setup token (first account only)
|
||||||
|
<input
|
||||||
|
class="field-input"
|
||||||
|
type="password"
|
||||||
|
name="setupToken"
|
||||||
|
autocomplete="off" /></label
|
||||||
><button class="primary-btn" type="submit">Log in</button
|
><button class="primary-btn" type="submit">Log in</button
|
||||||
><button class="ghost-btn" type="button" id="signup">
|
><button class="ghost-btn" type="button" id="signup">
|
||||||
Create account
|
Create account
|
||||||
|
|||||||
Reference in New Issue
Block a user