-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: idkit state and error handling improvements #194
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
solves an issue where reopening the IDKit widget would resubmit the same proof to the callback functions
throws connection_failed error if pollForUpdates gets a 404 from bridge (meaning request has expired)
ensures that handleVerify callbacks are processed async so the promise can reject on thrown errors and display them nicely in IDKit
checks to ensure the credential_type in the proof returned from the bridge is one of the configured credential_types, and displays the relevant error if not this should only happen when manually selecting the wrong credential in the simulator, but good to have anyway
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
pdtfh
approved these changes
Dec 6, 2023
Merged
This was referenced Dec 7, 2023
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Closed
This was referenced Jul 9, 2024
Merged
Closed
Closed
Merged
Merged
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves an issue I demo'd to @m1guelpf where IDKit would resubmit a proof to callback functions when it was reopened. The bridge store in
idkit-core
wasn't clearing theresult
anderrorCode
on reset, so these values were getting picked up again when enteringWorldIDState
.Also adds proper error when a proof request times out (such as when a user never scans the QR code or never clicks "Verify with World ID" in the app). This is a distinct error from a user rejecting a proof request.
Also fixes an issue where if an error was thrown synchronously in
handleVerify
, the error would not be properly displayed by IDKit. Resolved by always callinghandleVerify
callbacks as async so the thrown error is handled as promise rejection.Also ensures that the
credential_type
returned in the proof matches the configured acceptedcredential_types
. This should only happen when manually selecting the wrong credential in the Simulator (as World App should prevent the proof from being generated at all if the requested credential is not available), but it's a good check to have.