Repository navigation
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This branch has not been deployed
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.
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.examplesetVITE_DREAMSYNC_BASE_URLtohttp://localhost:8888, which is the Vite client's own port. The DreamSync API listens on4001, and the rest of the repo (e.g.w3ds-gatewaycapabilities, the registry) treats this variable as the API address. So the login page requested/api/auth/offerfrom the client dev server. Vite's SPA fallback answered withindex.htmland a 200 status.response.data.offerwas thenundefined, and the{qrCode && ...}block silently rendered nothing, with no error shown.Changes:
.env.example:VITE_DREAMSYNC_BASE_URLnow points at the API (http://localhost:4001).shared/auth-offer.schema.ts: a Zod schema for theGET /api/auth/offerresponse.offermust be aw3ds://authURI andsessionIdmust 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.testscript, plus tests for the login screen.If production shows the same blank card, check that its
VITE_DREAMSYNC_BASE_URLpoints 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.yamlalso 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
How the change has been tested
client/src/components/auth/login-screen.test.tsx. It renders the login screen with the API client mocked, for three cases:pnpm --filter dreamsync testgives 3 passed.tsc(the client'scheckscript) andvite buildboth pass.Change checklist