fix: recover auth from masterKeySig in URL fallback path#29
Draft
fix: recover auth from masterKeySig in URL fallback path#29
Conversation
This file contains hidden or 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
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.
Summary
When a user opens a
vana://connect?...&masterKeySig=0x...deep link, the data export flow completes but clicking "Allow" on the grant page fails with "Not signed in". ThemasterKeySigis cryptographically sufficient to derive the wallet address (viarecoverAddress), so the user should be authenticated without any extra sign-in step.Root cause
useDeepLinkhas two code paths:handleGrantParamswhich runsrecoverAddress→ dispatchessetAuthenticated. Works correctly.location.search(page reload, dev mode, re-mount). This path only calledsetDeepLinkParamsandnavigate— it never calledrecoverAddressorsetAuthenticated. Auth state was silently lost.The error surfaced in
use-grant-flow.tswherehandleApprovechecks!isAuthenticated || !walletAddressand bails.Fix
Added the same
recoverAddress+setAuthenticatedrecovery logic to the fallback effect inuse-deep-link.ts. Whenparams.masterKeySignatureis present in URL params, the fallback path now derives the wallet address and populates Redux auth state. The dispatch is idempotent — if auth is already set from the native path, re-dispatching with the same values is a no-op.Validation
masterKeySigin URL params (no Tauri plugin trigger), assertsrecoverAddressis called andsetAuthenticatedis dispatchedtsc -bclean (no type errors)