Skip to content

fix(eid-wallet): handle the first w3ds://auth deep link when the wallet is already signed in - #1224

Draft
coodos wants to merge 7 commits into
mainfrom
fix/issue-1222
Draft

coodos wants to merge 7 commits into
mainfrom
fix/issue-1222

Conversation

@coodos

@coodos coodos commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description of change

If the wallet was already open on /scan-qr and showing the previous login's "signed in" drawer, a new w3ds://auth link was treated as a duplicate and dropped. This happens when you log out of a platform and tap "Login with eID" again. Only a second tap went through.

goto("/scan-qr") does nothing when the page is already the current route, so the page receives the link as a deepLinkReceived event instead. Its duplicate guard used to skip any auth link while the consent drawer or the signed-in drawer was open.

What changed in scanLogic.ts:

  • First tap is handled. The signed-in drawer now counts as a finished login. An auth link is only skipped if it repeats the session whose consent drawer is open. A link for a different session replaces the open consent.
  • An approval is tied to its request. handleAuth() reads the session, redirect and scan/deep-link origin before its first await. A link that arrives while the wallet is signing can no longer send that signature to another platform or session. Auth links that arrive while a login is being signed are ignored, so the consent is not closed under the user.
  • A handler only clears its own payload. The page used to clear the stored payload after handling finished. A blind vote waits on a poll fetch, so a late finish could erase a link stored after the page unmounted. Now the event path clears once every listener of that dispatch has run. The mount path clears right after reading the payload.
  • The in-memory Storage used by the deep-link specs is now one shared utility ($lib/utils/memoryStorage.utils.ts).
  • docs/architecture/deepLink.md describes the behaviour when /scan-qr is already open.

The redirect parameter on Android, raised in the same issue, is not changed here.

Issue Number

#1222

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

  • New unit tests in src/routes/(app)/scan-qr/scanLogic.spec.ts. Each one first failed against the old code:
    • an auth link over the signed-in drawer opens the consent drawer on the first delivery
    • a stored payload is cleared once the open page has shown it
    • a repeat of the open request is still ignored, and a newer session replaces it
    • a second platform's link arriving while the signature is pending does not change where the approved login goes (origin and session of the opened login URL)
    • a newer link stored while an earlier blind-vote link is still being handled survives, on both the event path (after unmount) and the mount path
  • npx vitest run --project eid-wallet: 8 files, 125 tests passing.
  • biome check ./src is clean. svelte-check reports no errors in the changed files.

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coodos coodos changed the title fix/issue-1222 fix(eid-wallet): handle the first auth deep link when the scan page is already open Nov 23, 2026
@coodos coodos changed the title fix(eid-wallet): handle the first auth deep link when the scan page is already open fix(eid-wallet): handle the first w3ds://auth deep link when the wallet is already signed in Nov 23, 2026

This branch has not been deployed

No deployments
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.

1 participant