Repository navigation
Conversation
seamless-auth-api#614 stops GET /magic-link/verify/:token from signing in. It always answers 409 confirmation_required with sameDevice, and only a confirm carrying the code from the link's #code= fragment consumes the link. The api, adapter and browser specs now take the code from the delivered link and confirm with it, and new specs cover a missing code, a wrong code and the adapter forwarding the confirm body. The Angular, Vue and Svelte reference apps pin their SDK releases instead of latest, which the CI build cache would otherwise keep at an older release.
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.
Part of fells-code/seamless-auth-api#603. Follows fells-code/seamless-auth-api#614 (M6, fells-code/seamless-auth-api#594), which broke the
verifyjob in every repo that runs this suite.What changes
The suite moves to the magic link contract from api#614:
<target>?token=T#code=C.GET /magic-link/verify/:tokennever signs in. It answers409 confirmation_requiredwithsameDevice.POST /magic-link/verify/:token/confirmwith{ code }consumes the link.Harness flows
lib/flows.ts:parseMagicLinksplits the deliveredmagicLinkUrlinto token and code. It also asserts that the code is in the fragment and not in the query.requestMagicLinkreturns both, andconfirmMagicLinkis new.verifyMagicLinkoptionally sends the ephemeral bearer.lib/adapterFlows.ts:loginViaMagicLinkreads the link from/__capturedand expects the 409 withsameDevice: true. It then confirms with the code through the adapter and polls for the session.New assertions
sameDevice: true, and the link stays unconsumed after a verify.Browser specs
react/magicLinkLogin.spec.tsandnextjs/magicLinkLogin.spec.tsopen the full captured link, fragment included. Each verify must answer 409, and each confirm must succeed with at least one sent. Under Strict Mode, a screen that confirms twice spends the link on the first confirm and fails the second, so the double confirm is caught. The React spec also checks that the screen strips the code from the address bar.Reference apps
The Angular, Vue and Svelte apps pin
@seamless-auth/angular0.6.0,@seamless-auth/vue0.5.0 and@seamless-auth/svelte0.5.0. Before, the Dockerfiles defaulted tolatest, and the CI build cache keys that layer on its command and build args, solatestkept serving the release it first resolved. The React and Next.js apps come from seamless-templates, and fells-code/seamless-templates#175 moves them to client 0.11.0, react 0.21.0 and nextjs 0.11.0.Docs and release
verify/CONFORMANCE.mddescribes the new contract. The changeset ispatch, matching the earlier harness contract changes (#345, #353, #374).Local runs
Each run used API main (
45530a8) and a freshSEAMLESS_RUN_ID. Ports 3000 and 5312 are held by another stack on the machine, so a scratch compose override moved the auth API to 5313 and the Express adapter to 3002.--local --dev, templates main:http://localhost:3000for the adapter, so they reached the other stack on the machine and not the verify adapter.--dev(published SDKs), templates#175: 10 of 13 layers pass, including API/adapter, react-vite, react-oauth, and Next.js on both build and dev. The other 3 are the same Angular, Vue and Svelte dev layers, which fail for the port reason above.This PR's own conformance job runs the dev layers on clean ports.
Callers to re-pin after release
verify-conformance.ymlchecks out this repo atinputs.cli-ref. Callers that leave it empty get the harness frommain, so their matrix job is fixed when this merges. They still pin the workflow file itself:seamless-auth-server.github/workflows/conformance.yml:ab96e73).nextjsjob checks out this repo at v0.30.3 explicitly, so its specs stay on the old contract until it is re-pinned.seamless-auth-api.github/workflows/conformance.yml: workflow pinned at v0.27.2 (28a363f).seamless-templates.github/workflows/conformance.yml: workflow pinned at v0.26.0 (1ff9552).mainand need no change:seamless-auth-js, whose conformance workflow uses@main.seamless-auth-go,seamless-auth-pythonandseamless-auth-rust, whose CI checks out this repo with no ref.