Passkeys: agents and client portal contacts can add a passkey with their password and sign in with it instead of their email and password, counting as two-step sign-in; a passkey that supports PRF also opens an agent's credential vault, otherwise credentials stay locked until they type their password once; admins can turn passkeys off in Security settings, and resetting MFA, turning off a contact's two-step sign-in, archiving an agent and the incident password reset remove them; database 4.2.2 adds user_passkeys, users.user_passkey_handle and settings.config_login_passkeys, and lbuchs/WebAuthn 2.2.0 is bundled in libs/webauthn

This commit is contained in:
johnnyq
2026-11-28 23:31:17 -05:00
parent 4a2933cac9
commit d9c1c752bd
50 changed files with 4679 additions and 46 deletions

View File

@@ -23,6 +23,9 @@ $form_id = 'userForm' . ($is_new ? 'New' : $form_user_id);
$form_role_id = intval($form['user_role_id'] ?? 0);
$form_roles = userRoles($form_role_id);
$form_has_mfa = trim((string) ($form['user_token'] ?? '')) !== '';
// Their passkeys count as MFA - resetting it takes them away too (functions/passkey.php)
$form_passkeys = !empty($form_user_id) && passkeysReady() ? passkeyCount($form_user_id) : 0;
$form_has_mfa = $form_has_mfa || $form_passkeys > 0;
$form_has_avatar = trim((string) ($form['user_avatar'] ?? '')) !== '';
$form_access = $form_user_id ? userClientAccess([$form_user_id])[$form_user_id] : ['allow' => [], 'deny' => []];
$form_invites = $is_new && userInvitesReady();
@@ -170,7 +173,7 @@ $value = function ($key) use ($form) {
<div class="form-check mt-2">
<input class="form-check-input" type="checkbox" name="reset_mfa" value="1" id="<?= $form_id ?>ResetMfa">
<label class="form-check-label" for="<?= $form_id ?>ResetMfa">Reset it</label>
<div class="form-text mt-0">For a lost or replaced phone - their authenticator app is forgotten, and so are their remembered browsers.</div>
<div class="form-text mt-0">For a lost or replaced phone - their authenticator app is forgotten, and so are their remembered browsers<?= $form_passkeys ? ' and their ' . ($form_passkeys === 1 ? 'passkey' : "$form_passkeys passkeys") : '' ?>.</div>
</div>
<?php } ?>
</div>