Files
fizzy/app/views/users/credentials/index.html.erb
T
Stanko K.R. fbe9252db1 Auto-suggest name for new Passkeys
- Use plain client data json everywhere
- Expose AAGUID and backed_up on Credentials
- Make attestation verifiers configurable
- Auto-suggest names for passkeys and show icons
2026-03-18 11:49:59 +01:00

41 lines
1.6 KiB
Plaintext

<% @page_title = "Passkeys" %>
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to "My profile", user_path(Current.user), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title" data-bridge--title-target="header"><%= @page_title %></h1>
<% end %>
<section class="panel panel--wide shadow center"
data-controller="credential"
data-credential-public-key-value="<%= @creation_options.as_json.to_json %>"
data-credential-register-url-value="<%= user_credentials_path(Current.user) %>">
<p class="margin-none-block-start"><strong>Passkeys let you sign in securely without a password or email code.</strong></p>
<% if @credentials.any? %>
<ul class="flex flex-column gap margin-none-block-start unpad full-width">
<%= render partial: "users/credentials/credential", collection: @credentials %>
</ul>
<% end %>
<p class="txt-small pad-inline-double pad-block-half">Your browser will prompt you to create a passkey
using your device's biometrics, PIN, or security key</p>
<button type="button" data-action="credential#create" data-credential-target="button" class="btn btn--link center txt-medium">
<%= icon_tag "add" %>
<span>Register passkey</span>
</button>
<p data-credential-target="error" class="txt-negative" hidden>
Something went wrong while registering your passkey.
</p>
<p data-credential-target="cancelled" class="txt-subtle" hidden>
Passkey registration was cancelled.
Try again when you are ready.
</p>
</section>