Skip to content
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

Fix enter verification process from unconnected state #899

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

storywithoutend
Copy link
Collaborator

@storywithoutend storywithoutend commented Oct 24, 2024

When processing the code received from dentity.com when returning from their site, the manager app would fail because the app would refresh, causing a refetch of the name info which is one time use only.

FIX:
Split the processing of the code into two hooks:

  1. useDentityToken - Is only responsible for the name info from dentity.com. This has a staleTime of Infinity and a queryDependencyType of independent. This was necessary because the former queryDependencyType of standard injects the user's address into the queryKey, triggering a refetch when the page is reloaded.
  2. useDentityProfile - Processes the dentity token and adds additional information such as the owner, manager, resolver address and current verification uri.

To test the implementation, in the e2e tests, the mock return function has been updated to return an error message on a refetch and a page.reload was added to ensure that the cache is working properly.

I also renamed the functions to make it more clear what the functions do and removed extraneous functions that are not needed since 'dentity' is currently the only service this hook supports at the moment.

Copy link

cloudflare-workers-and-pages bot commented Oct 24, 2024

Deploying ens-app-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 19807a5
Status: ✅  Deploy successful!
Preview URL: https://315aabe1.ens-app-v3.pages.dev
Branch Preview URL: https://dentity-oauth-from-unconnect.ens-app-v3.pages.dev

View logs

Copy link

@sugh01 sugh01 merged commit 36e6041 into main Oct 30, 2024
40 checks passed
@sugh01 sugh01 deleted the dentity-oauth-from-unconnected-fix branch October 30, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants