Skip to content

fix(dreamsync): show the login QR code again and surface auth offer failures - #1225

Draft
coodos wants to merge 4 commits into
mainfrom
fix/issue-1223
Draft

coodos wants to merge 4 commits into
mainfrom
fix/issue-1223

Conversation

@coodos

@coodos coodos commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description of change

The DreamSync login card showed the instructions and platform description, but the QR code (or the mobile "Login with eID Wallet" button) was missing.

Cause: .env.example set VITE_DREAMSYNC_BASE_URL to http://localhost:8888, which is the Vite client's own port. The DreamSync API listens on 4001, and the rest of the repo (e.g. w3ds-gateway capabilities, the registry) treats this variable as the API address. So the login page requested /api/auth/offer from the client dev server. Vite's SPA fallback answered with index.html and a 200 status. response.data.offer was then undefined, and the {qrCode && ...} block silently rendered nothing, with no error shown.

Changes:

  • .env.example: VITE_DREAMSYNC_BASE_URL now points at the API (http://localhost:4001).
  • New shared/auth-offer.schema.ts: a Zod schema for the GET /api/auth/offer response. offer must be a w3ds://auth URI and sessionId must be non-empty.
  • login-screen.tsx: the offer response is validated against that schema. If the request fails or returns something that isn't an auth offer, the card shows "We could not load the login code. Please refresh the page to try again." instead of an empty space.
  • Adds Vitest, jsdom and Testing Library to the DreamSync client with a test script, plus tests for the login screen.

If production shows the same blank card, check that its VITE_DREAMSYNC_BASE_URL points at the API. The client must be rebuilt after changing it because the value is baked in at build time. With this change, a misconfiguration now shows an error message instead of an empty card.

Note: pnpm-lock.yaml also changes outside DreamSync (about 105 lines). Adding the dependencies made pnpm re-resolve some peer entries for other packages. jsdom 19 was chosen because the workspace already uses it.

Issue Number

Closes #1223

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

  • Added client/src/components/auth/login-screen.test.tsx. It renders the login screen with the API client mocked, for three cases:
    • A valid auth offer: the QR code SVG renders.
    • The offer endpoint returns an HTML page: the error message shows.
    • The offer request fails: the error message shows.
  • The last two cases failed before the fix (empty card) and pass after it. pnpm --filter dreamsync test gives 3 passed.
  • tsc (the client's check script) and vite build both pass.

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-1223 fix(dreamsync): show the login QR code again and surface auth offer failures 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.

[Bug] [DreamSync] QR code not displayed on login page

1 participant