feat: login - passkey button under the password form, the sign-in button full width

This commit is contained in:
redtea committed 2026-10-15 10:39:00 +03:00
1 parent dbb46173a3
commit fc488717d3
2 files changed
+4 -3

No files matched your search

+1
View File
@@ -210,6 +210,7 @@ input.sw:disabled { opacity: .45; cursor: not-allowed; }
/* Sign-in page. */
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.or + .keybtn { margin-top: 10px; }
.keybtn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* Phones. A table marked .stack turns each row into a block of
+3 -3
View File
@@ -11,15 +11,15 @@
<div class="card">
<h1>Вход в панель</h1>
{{if .Error}}<div class="err" id="err">{{.Error}}</div>{{else}}<div class="err" id="err" hidden></div>{{end}}
<button type="button" class="keybtn" id="keylogin" hidden><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7.5" cy="15.5" r="4.5"/><path d="m21 2-9.6 9.6M15.5 7.5l3 3L22 7l-3-3"/></svg>Войти с ключом доступа</button>
<div class="or" id="or" hidden>или по паролю</div>
<form method="post" action="/login">
<label for="u">Имя пользователя</label>
<input type="text" id="u" name="username" value="{{.Username}}" autocomplete="username webauthn" autofocus required>
<label for="pw">Пароль</label>
<input type="password" id="pw" name="password" autocomplete="current-password" required>
<div style="margin-top:18px"><button type="submit">Войти</button></div>
<div style="margin-top:18px"><button type="submit" style="width:100%">Войти</button></div>
</form>
<div class="or" id="or" hidden>или</div>
<button type="button" class="keybtn btn ghost" id="keylogin" hidden><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7.5" cy="15.5" r="4.5"/><path d="m21 2-9.6 9.6M15.5 7.5l3 3L22 7l-3-3"/></svg>Войти с ключом доступа</button>
</div>
</div>
<script>