prepare("SELECT finger_id, code_register FROM account WHERE id_account = ?"); $stmt->execute([$id_account]); $acc = $stmt->fetch(PDO::FETCH_ASSOC); if (!$acc) { header("Location: register.php"); exit; } if (!empty($acc['finger_id'])) { $error = "Fingerprint for this account has already been registered!"; } else { // Generate/retrieve code_register and build URL for scanning on different device $code = $acc['code_register'] ?? null; if (!$code) { $code = sprintf("%06d", mt_rand(1, 999999)); $update = $pdo->prepare("UPDATE account SET code_register = ? WHERE id_account = ?"); $update->execute([$code, $id_account]); } $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"; $host = $_SERVER['HTTP_HOST']; $uriPath = dirname($_SERVER['REQUEST_URI']); if ($uriPath == '/' || $uriPath == '\\') $uriPath = ''; $differentDeviceUrl = $protocol . "://" . $host . $uriPath . "/scan_here.php?token=" . $code; } } catch (PDOException $e) { $error = "A database error occurred."; } ?> Register Passkey - Identia
logo

Enable Touch ID

Register your fingerprint for faster login.

Warning
Message goes here