Добавил повторение пароля
This commit is contained in:
parent
5c72b569da
commit
c64d3bf2d9
1 changed files with 8 additions and 0 deletions
|
|
@ -32,6 +32,10 @@ if (Astro.cookies.has("session")) {
|
|||
<label for="password" class="form-label">Пароль</label>
|
||||
<input type="password" class="form-control" id="password" id="login" name="password" required />
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label for="passwordConfirm" class="form-label">Повтор пароля</label>
|
||||
<input type="password" class="form-control" id="passwordConfirm" id="login" name="passwordConfirm" required />
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Зарегистрироваться</button>
|
||||
</div>
|
||||
|
|
@ -49,6 +53,10 @@ if (Astro.cookies.has("session")) {
|
|||
async function doRegistration(form) {
|
||||
try {
|
||||
const fd = new FormData(form);
|
||||
if (fd.get("password") && fd.get("password") !== fd.get("passwordConfirm")) {
|
||||
alert("Пароли не совпадают");
|
||||
return;
|
||||
}
|
||||
const resp = await fetch("/gate/register", {
|
||||
method: "POST",
|
||||
body: fd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue