Skip to content

Commit

Permalink
automatically focus passkey button if pre-filling username
Browse files Browse the repository at this point in the history
  • Loading branch information
foodelevator committed Nov 13, 2024
1 parent e6b6e93 commit 515e9c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion templates/passkey.templ
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ templ PasskeyLoginForm(kthid string, credAss *protocol.CredentialAssertion) {
id="passkey-login-form"
hx-post="/login/passkey/begin"
_="
on load if localStorage.logout_saved_kthid then set #pk-kthid.value to localStorage.logout_saved_kthid end
on load if localStorage.logout_saved_kthid then set #pk-kthid.value to localStorage.logout_saved_kthid then call #pk-init.focus() end
on submit remove <.error/> then if #pk-kthid.value then set localStorage.logout_saved_kthid to #pk-kthid.value
"
if credAss != nil {
Expand Down Expand Up @@ -81,6 +81,7 @@ templ PasskeyLoginForm(kthid string, credAss *protocol.CredentialAssertion) {
"
/>
<button
id="pk-init"
class={ `
bg-[#3f4c66] shrink-0 h-8 w-8 rounded-full
grid place-items-center pointer
Expand Down
10 changes: 5 additions & 5 deletions templates/passkey_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 515e9c6

Please sign in to comment.