mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
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:
@@ -268,7 +268,8 @@ function credentialFormSet($post, $client_id, &$error = '') {
|
||||
$password = encryptCredentialEntry(trim((string) ($post['password'] ?? '')));
|
||||
$otp = credentialOtpEncrypt($otp);
|
||||
if ($username === false || $password === false || $otp === false) {
|
||||
$error = 'Your vault session has expired, so the login could not be encrypted - sign out and back in, then try again.';
|
||||
$error = vaultLocked() ? 'Your credentials are locked - you signed in with a passkey that can\'t open them. Unlock them with your password (the lock beside a username), then save again.'
|
||||
: 'Your vault session has expired, so the login could not be encrypted - sign out and back in, then try again.';
|
||||
return null;
|
||||
}
|
||||
$text = function ($field, $length) use ($post) {
|
||||
@@ -312,6 +313,10 @@ function credentialUsername($row) {
|
||||
/** The username with its copy button, or a dash. Raw in. */
|
||||
function credentialUsernameHtml($username, $empty = '-') {
|
||||
$username = escapeHtml($username);
|
||||
if ($username === '' && vaultLocked()) {
|
||||
// Signed in with a passkey that couldn't open the vault - their password unlocks it (js/credentials.js)
|
||||
return '<a href="#" class="text-body-secondary text-decoration-none" data-vault-unlock data-vault-locked title="Unlock with your password"><i class="fas fa-lock me-1"></i>Locked</a>';
|
||||
}
|
||||
if ($username === '') {
|
||||
return '<span class="text-body-secondary">' . $empty . '</span>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user