Skip to content

Frontend RequireAuth route guard - #51

Merged
askmy-stack merged 2 commits into
mainfrom
security/frontend-require-auth
Aug 10, 2026
Merged

Frontend RequireAuth route guard#51
askmy-stack merged 2 commits into
mainfrom
security/frontend-require-auth

Conversation

@askmy-stack

Copy link
Copy Markdown
Owner

Summary

  • Add RequireAuth wrapper; protect dashboard routes (closes Frontend route-level auth guard #28)
  • /login remains public; JWT still stored in localStorage
  • Vitest coverage for redirect vs authenticated render

Test plan

  • npx vitest run src/components/RequireAuth.test.jsx
  • Unauthenticated /alerts redirects to /login
  • CI green

Made with Cursor

askmy-stack and others added 2 commits August 10, 2026 10:31
Unauthenticated visitors are redirected to /login; JWT remains in localStorage after login.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@askmy-stack
askmy-stack merged commit 7b0387f into main Aug 10, 2026
6 checks passed
@askmy-stack
askmy-stack deleted the security/frontend-require-auth branch August 10, 2026 14:55
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.

Frontend route-level auth guard

1 participant