@@ -166,7 +166,7 @@ try {
|
||||
$data->userDisplayName = $userDisplayName;
|
||||
|
||||
// Store registration data in the database
|
||||
$credentialId = $data->credentialId instanceof \lbuchs\WebAuthn\Binary\ByteBuffer ? $data->credentialId->getBinaryString() : $data->credentialId;
|
||||
$credentialId = $data->credentialId instanceof \lbuchs\WebAuthn\Binary\ByteBuffer ? $data->credentialId->getBinaryString() : (string)$data->credentialId;
|
||||
$credentialPublicKey = $data->credentialPublicKey;
|
||||
$signatureCounter = (int)$data->signatureCounter;
|
||||
$stmt = $conn->prepare("UPDATE users set credential_id = ?, public_key = ?, counter = ?, auth_method_enabled_passkey = 1, auth_method_required_passkey = 1 WHERE username = ?");
|
||||
@@ -187,7 +187,7 @@ try {
|
||||
} catch (Throwable $ex) {
|
||||
$return = new stdClass();
|
||||
$return->success = false;
|
||||
$return->msg = 'Passkey registration failed: ' . $ex->getMessage();
|
||||
$return->msg = 'Passkey registration failed: ' . $ex->getMessage() . ' (credentialId type: ' . (is_object($data->credentialId ?? null) ? get_class($data->credentialId) : gettype($data->credentialId ?? null)) . ')';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
print(json_encode($return));
|
||||
|
||||
Reference in New Issue
Block a user