Skip to content

fix: resolve auth routing redirects and repair e2e test suite#1544

Open
ArshVermaGit wants to merge 9 commits into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_4
Open

fix: resolve auth routing redirects and repair e2e test suite#1544
ArshVermaGit wants to merge 9 commits into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_4

Conversation

@ArshVermaGit
Copy link
Copy Markdown
Contributor

Description

This PR resolves the critical Authentication / Routing bug where unauthenticated users were incorrectly redirected to /auth/signin instead of the root / when attempting to access protected dashboard routes. Additionally, it addresses false-positive test failures by syncing the AppNavbar rendering behavior with Playwright expectations.

Resolved Issue

Resolves #1543

Changes Made

  • Dashboard Guard Remediation: Replaced the default next-auth redirect behavior in src/app/dashboard/layout.tsx with an explicit onUnauthenticated() handler that pushes the router to /.
  • Public Profile Navigation Link: Modified src/components/AppNavbar.tsx to hide the "Sign in with GitHub" link when the user is unauthenticated and viewing a public profile page (/u/*), resolving the toHaveCount(0) expectation failure.
  • Server Component Stabilization: Removed the invalid { ssr: false } flag from dynamic component imports in src/app/dashboard/page.tsx that previously broke Next.js 15 builds and caused subsequent server crash loops.

Impact

  • End-to-End Tests: npm run test:e2e now completes with 16 passed and 0 failed.
  • Authentication Flow: The application now seamlessly routes unauthenticated attempts on protected pages back to the landing page without surfacing the standalone /auth/signin page directly.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@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.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:security GSSoC type bonus: security (+20 pts) type:testing GSSoC type bonus: tests (+10 pts) labels May 29, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Copy link
Copy Markdown
Contributor Author

@ArshVermaGit ArshVermaGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Priyanshu-byte-coder ! Issue #1543 has been resolved. Please review the PR and merge it under GSSoC. Thanks!

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ArshVermaGit
Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:security GSSoC type bonus: security (+20 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Authentication Middleware / Route Protection Test Failures

2 participants