You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Hardware not available - show error and don't proceed
41
-
error="Your device doesn't support hardware-backed security keys required for passport verification. Please use the pre-verification code option instead.";
42
-
isPaneOpen=true;
43
-
preVerified=false;
44
-
setTimeout(() => {
45
-
error=null;
46
-
}, 8000);
42
+
// Actually try to generate a test hardware key
43
+
const testKeyId =`hardware-test-${Date.now()}`;
44
+
console.log("Testing hardware key generation with test key:", testKeyId);
45
+
46
+
try {
47
+
const { manager, created } =awaitglobalState.keyService.ensureKey(
48
+
testKeyId,
49
+
"onboarding"
50
+
);
51
+
console.log("Test key result - Manager type:", manager.getType(), "Created:", created);
52
+
53
+
// Check if we got hardware manager and it actually created a key
54
+
if (manager.getType() !=="hardware") {
55
+
thrownewError("Got software fallback instead of hardware");
56
+
}
57
+
58
+
// Hardware works! Clean up test key and proceed
59
+
console.log("Hardware keys are working");
60
+
checkingHardware=false;
61
+
} catch (keyError) {
62
+
console.error("Hardware key test failed:", keyError);
63
+
showHardwareError=true;
47
64
checkingHardware=false;
48
-
return;
49
65
}
50
-
51
-
// Hardware is available - proceed to verification
52
-
isPaneOpen=true;
53
-
preVerified=false;
54
66
} catch (err) {
55
-
console.error("Failed to check hardware availability:", err);
56
-
hardwareAvailable=false;
57
-
error="Unable to check device capabilities. Please use the pre-verification code option instead.";
58
-
isPaneOpen=true;
59
-
preVerified=false;
60
-
setTimeout(() => {
61
-
error=null;
62
-
}, 8000);
63
-
} finally {
67
+
console.error("Error checking hardware:", err);
68
+
showHardwareError=true;
64
69
checkingHardware=false;
65
70
}
66
71
};
@@ -138,8 +143,24 @@ async function getApplicationPublicKey() {
138
143
}
139
144
140
145
const handleNext =async () => {
141
-
//handle next functionlity
142
-
goto("/verify");
146
+
// Initialize keys for onboarding context before going to verify
0 commit comments