Skip to content

Commit 5cc3e08

Browse files
authored
Merg to prod (#514)
* fix: added project link * fix: updated Escrow Balance Fetching * feat: Add send and receive functionality to WalletSheet, including destination validation and transaction submission. * feat: Add hackathon winner export functionality and update API export types. * feat: Request camera permission proactively in `DiditVerifyButton` to prevent iframe access issues and add `task.md` outlining hackathon improvements.
1 parent 8ec5a84 commit 5cc3e08

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

components/didit/DiditVerifyButton.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@ export function DiditVerifyButton({
3030
setLoading(true);
3131
setError(null);
3232
try {
33+
// Request camera permission upfront so the browser has already granted it
34+
// before the Didit SDK iframe tries to access it. Without this, users who
35+
// have already granted permission still see camera access prompts/errors
36+
// because the iframe cannot inherit the permission from the parent origin.
37+
if (
38+
typeof navigator !== 'undefined' &&
39+
navigator.mediaDevices?.getUserMedia
40+
) {
41+
try {
42+
const stream = await navigator.mediaDevices.getUserMedia({
43+
video: true,
44+
});
45+
stream.getTracks().forEach(track => track.stop());
46+
} catch {
47+
setError(
48+
'Camera access is required for identity verification. Please allow camera access in your browser and try again.'
49+
);
50+
setLoading(false);
51+
return;
52+
}
53+
}
54+
3355
const { session_token, verification_url } = await createDiditSession(
3456
userId != null ? { user_id: userId } : undefined
3557
);

0 commit comments

Comments
 (0)