56 lines
2.1 KiB
HTML
56 lines
2.1 KiB
HTML
<article id="profile-authenticators">
|
|
<h5>Passkeys</h5>
|
|
<p>The authenticator that started the session is indicated as active.</p>
|
|
|
|
<h6>Credentials</h6>
|
|
{% if not user.credentials %}
|
|
<i>No credentials available</i>
|
|
{% endif %}
|
|
{% for credential in user.credentials %}
|
|
<fieldset id="profile-credential-{{ credential.id|hex }}"
|
|
hx-trigger="htmx:afterRequest[event.detail.successful==true] from:#profile-credential-{{ credential.id|hex }}"
|
|
hx-target="this"
|
|
hx-select="#profile-credential-{{ credential.id|hex }}"
|
|
hx-swap="outerHTML"
|
|
hx-get="/profile/">
|
|
{% if session["cred_id"] == credential.id|hex %}
|
|
<mark>in use</mark>
|
|
{% endif %}
|
|
<span _="install inlineHtmxRename()"
|
|
contenteditable
|
|
data-patch-parameter="friendly_name"
|
|
spellcheck="false"
|
|
hx-patch="/profile/credential/{{ credential.id|hex }}"
|
|
hx-trigger="editContent">
|
|
{{- credential.friendly_name or 'John Doe' -}}
|
|
</span>
|
|
<a href="#" hx-disinherit="*" class="{{ "color-red" if not credential.active else "color-green"}}"
|
|
hx-patch="/profile/credential/{{ credential.id|hex }}"
|
|
hx-vals='js:{"active": {{ "true" if not credential.active else "false"}}}'
|
|
hx-params="active">{{ "[disabled]" if not credential.active else "[enabled]"}}</a>
|
|
|
|
<a href="#" hx-disinherit="*" class="color-red"
|
|
hx-confirm="Delete passkey?"
|
|
_="install confirmButton"
|
|
hx-trigger="confirmedButton throttle:200ms"
|
|
hx-delete="/profile/credential/{{ credential.id|hex }}">[remove]</a>
|
|
<br>
|
|
<small>Last Login:
|
|
{% if credential.last_login %}
|
|
<span class="" value="{{ credential.last_login }}" _="init set dt to my @value js(dt) return new Date(dt).toLocaleString() end then put result into me"></span>
|
|
{% else %}-
|
|
{% endif %}
|
|
</small>
|
|
</fieldset>
|
|
{% endfor %}
|
|
|
|
<button type="submit" hx-post="/auth/register/webauthn/options"
|
|
data-loading-disable
|
|
id="register"
|
|
hx-target="this"
|
|
hx-swap="innerHTML">
|
|
Add authenticator
|
|
</button>
|
|
|
|
</article>
|