Skip to content

Fix frontend auth success routing - #7

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-ae88
Closed

Fix frontend auth success routing#7
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-ae88

Conversation

@cursor

@cursor cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

Bug and impact

Successful login/signup crashed in the frontend because the success handler expected data.session.access_token, while the backend returns data.tokens.accessToken. Even if that crash was bypassed, auth redirected to /dashboard while the dashboard page lived in a route group that resolved to /, creating a broken post-auth path and a root route conflict.

Root cause

The frontend auth response type and hook were out of sync with the backend auth contract, and the dashboard route files were placed under app/(dashboard) instead of the /dashboard URL segment used by redirects and navigation.

Fix

  • Updated frontend auth response typing and useAuth success handlers to read tokens.accessToken / tokens.refreshToken.
  • Moved the dashboard layout, dashboard page, recipes page, and layout test to app/dashboard/... so /dashboard and /dashboard/recipes are real routes.
  • Added regression tests for login/signup success token storage and dashboard navigation.

Validation

  • pnpm --filter @snacktrack/frontend test -- src/lib/hooks/use-auth.test.tsx src/app/dashboard/layout.test.tsx -> 5 tests passed.
  • pnpm --filter @snacktrack/shared-types build && pnpm --filter @snacktrack/frontend build -> production build succeeded and listed /dashboard and /dashboard/recipes routes.
  • Manual browser walkthrough recorded for /dashboard -> /dashboard/recipes -> /dashboard routing.
Open in Web View Automation 

Co-authored-by: Vasanth Panuganti <vpanuga2@asu.edu>
@vasanthpanuganti
vasanthpanuganti deleted the cursor/critical-bug-investigation-ae88 branch June 11, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants