32 lines
1.4 KiB
Plaintext
32 lines
1.4 KiB
Plaintext
<% @page_title = "Add a passkey" %>
|
|
|
|
<% content_for :header do %>
|
|
<div class="header__actions header__actions--start">
|
|
<%= back_link_to "Passkeys", user_credentials_path(@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 txt-align-start">
|
|
<%= form_with url: user_credentials_path(@user),
|
|
data: { controller: "credential", credential_public_key_value: @creation_options.as_json },
|
|
html: { class: "flex flex-column gap" } do |form| %>
|
|
|
|
<div class="flex flex-column gap-half">
|
|
<strong><label for="credential_name">Passkey name</label></strong>
|
|
<input type="text" id="credential_name" name="credential[name]" required autofocus class="input" placeholder="e.g. MacBook Pro, iPhone">
|
|
</div>
|
|
|
|
<input type="hidden" name="credential[response][client_data_json]" data-credential-target="clientDataJSON">
|
|
<input type="hidden" name="credential[response][attestation_object]" data-credential-target="attestationObject">
|
|
|
|
<button type="button" data-action="credential#create" class="btn btn--link center txt-medium">
|
|
<%= icon_tag "add" %>
|
|
<span>Register passkey</span>
|
|
</button>
|
|
<% end %>
|
|
|
|
<%= link_to "Cancel and go back", user_credentials_path(@user), hidden: true %>
|
|
</section>
|