Repository navigation
DID-9565: [QA-WEB-AUTH-NEXTJS] Next.js Authentication routes, middleware and server sessions - #31
Merged
Merged
Conversation
…are and server sessions
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.
Problem
Two defects surfaced in the release QA of the Next.js authentication sample, and one layout bug:
/auth/reauthenticateafter its session had ended was answered{"error":"signed_out"}— raw JSON after an ordinary link click.Solution
packages/auth-nextjs/src/server/proxy.ts: when no session is left, reauthentication now redirects a browser to/auth/sign-inwithredirect_urlkept; the SDK's own fetch client still gets the 401.proxy.ts: ending the earlier session on sign-in is best effort, so a Didit failure no longer discards the new session cookies.examples/nextjs/app/globals.css: the home page's lead line wraps long values instead of overflowing.Verification
npm run test:auth— 153 tests pass; the two new proxy tests fail on the previous source and pass with the fix.npm run typecheck:auth, ESLint on the touched packages — clean.next buildof the sample, then a realnext startwith a local Frontend API stand-in: the 390 px page measured 601 px wide before and 390 px after, and/auth/reauthenticatereturned 401 JSON before and a 307 to the hosted sign-in after. Screenshots are in the proof folder.Visual proof
Next.js authentication slice: before and after
before-390-long-email.png/after-390-long-email.png— the sample's home page at 390 px with a 68-character email. Before, the page scrolled 601 px wide; after it stays at 390 px and the address wraps.before-reauthenticate.png/after-reauthenticate.png— a browser opening/auth/reauthenticate?...after its session ended. Before, raw{"error":"signed_out"}; after, the hosted sign-in page withredirect_urlkept.Both runs used a real
next build/next starton the sample with a local stand-in for the Frontend API.