fix: resolve auth routing redirects and repair e2e test suite#1544
fix: resolve auth routing redirects and repair e2e test suite#1544ArshVermaGit wants to merge 9 commits into
Conversation
|
@ArshVermaGit is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
ArshVermaGit
left a comment
There was a problem hiding this comment.
Hi @Priyanshu-byte-coder ! Issue #1543 has been resolved. Please review the PR and merge it under GSSoC. Thanks!
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Please remove the debug files fix.js and fix2.js from this PR before merging. These are development artifacts and should not be committed to the repository.
fixed it please review |
Description
This PR resolves the critical Authentication / Routing bug where unauthenticated users were incorrectly redirected to
/auth/signininstead of the root/when attempting to access protected dashboard routes. Additionally, it addresses false-positive test failures by syncing theAppNavbarrendering behavior with Playwright expectations.Resolved Issue
Resolves #1543
Changes Made
next-authredirect behavior insrc/app/dashboard/layout.tsxwith an explicitonUnauthenticated()handler that pushes the router to/.src/components/AppNavbar.tsxto hide the "Sign in with GitHub" link when the user is unauthenticated and viewing a public profile page (/u/*), resolving thetoHaveCount(0)expectation failure.{ ssr: false }flag from dynamic component imports insrc/app/dashboard/page.tsxthat previously broke Next.js 15 builds and caused subsequent server crash loops.Impact
npm run test:e2enow completes with16 passedand0 failed./auth/signinpage directly.Type of Change