-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
98 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
FLOW COMPOSITION | ||
Like the Every Layout stack: https://every-layout.dev/layouts/stack/ | ||
Info about this implementation: https://piccalil.li/quick-tip/flow-utility/ | ||
*/ | ||
.flow > * + * { | ||
margin-top: var(--flow-space, 1em); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
REPEL | ||
A little layout that pushes items away from each other where | ||
there is space in the viewport and stacks on small viewports | ||
CUSTOM PROPERTIES AND CONFIGURATION | ||
--gutter (var(--space-s-m)): This defines the space | ||
between each item. | ||
--repel-vertical-alignment How items should align vertically. | ||
Can be any acceptable flexbox alignment value. | ||
*/ | ||
.repel { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
align-items: var(--repel-vertical-alignment, center); | ||
gap: var(--gutter, var(--space-s-m)); | ||
} | ||
|
||
.repel[data-nowrap] { | ||
flex-wrap: nowrap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%= table_with(id: dom_id(admin, :credentials), collection: admin.credentials) do |t, c| %> | ||
<% t.text :nickname, label: "Name" %> | ||
<% t.date :updated_at, label: "Last use" do |date| %> | ||
<%= date unless c.created_at == c.updated_at %> | ||
<% end %> | ||
<% t.cell :actions, label: "" do %> | ||
<%= link_to("Remove passkey", admin_admin_user_credential_path(admin, c), | ||
data: { turbo_method: :delete }) %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<%= table_with(id: dom_id(admin, :credentials), collection: admin.credentials) do |t, c| %> | ||
<% t.text :nickname %> | ||
<% t.number :sign_count %> | ||
<% t.cell :actions, label: "" do %> | ||
<%= button_to "Remove device", admin_admin_user_credential_path(admin, c), method: :delete, class: "button button--text" %> | ||
<% end if admin == current_admin %> | ||
<% t.text :nickname, label: "Name" %> | ||
<% t.date :updated_at, label: "Last use" do |date| %> | ||
<%= date unless c.created_at == c.updated_at %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
<%= render Kpop::ModalComponent.new(title: "Register device") do %> | ||
<%= render Kpop::ModalComponent.new(title: "New passkey") do %> | ||
<%= form_with model: admin.credentials.new, | ||
url: admin_admin_user_credentials_path(admin), | ||
class: "flow prose", | ||
data: { | ||
controller: "webauthn-registration", | ||
action: "submit->webauthn-registration#submit", | ||
webauthn_registration_options_value: { publicKey: options }, | ||
} do |form| %> | ||
<%= form.govuk_text_field :nickname %> | ||
<%= form.hidden_field :response, data: { webauthn_registration_target: "response" } %> | ||
<%= form.admin_save %> | ||
<section class="flow prose" data-webauthn-registration-target="intro"> | ||
<p> | ||
Passkeys are secure secrets that are stored by your device. | ||
You will need the device where your passkey is stored to log in. | ||
</p> | ||
<p> | ||
Unlike a password, your password doesn't get sent to the server when you log | ||
in and can't be stolen in a data breach. When you log in with a passkey, | ||
your operating system will prompt you for permission to use the passkey | ||
secret to authenticate the login attempt. | ||
</p> | ||
<p> | ||
We recommend that you store your passkey on your phone or cloud account. | ||
Depending on your browser, you may need to choose "more options" to see | ||
a QR code that you can scan with your phone. | ||
</p> | ||
</section> | ||
<section class="flow" data-webauthn-registration-target="nickname" hidden> | ||
<%= form.govuk_text_field :nickname, label: { text: "Passkey name" } do %> | ||
Enter a name for this passkey to help you distinguish it from other passkeys you may have for this site. | ||
<br> | ||
Example: My Phone, Chrome, iCloud, 1Password | ||
<% end %> | ||
</section> | ||
<%= form.admin_save("Next") %> | ||
<% end %> | ||
<% end %> |