Skip to content

feat(web): create a protected route component for authenticated-only areas #20

@nullscribe

Description

@nullscribe

Type of Task

Feature

User Story / Goal

As a developer, I want to use a wrapper component to protect specific routes so that only authenticated users can access them, ensuring sensitive parts of the application are secure.

Acceptance Criteria

  • A new component (e.g., ProtectedRoute.tsx) is created.
  • The component checks for a valid user authentication state (e.g., presence of a JWT).
  • If the user is authenticated, the component renders the intended child page.
  • If the user is not authenticated, the component automatically redirects them to the /login page.

Technical Breakdown (Optional)

  • This component will wrap routes in the main router configuration file.
  • It will likely use React Router's useLocation and Navigate components.
  • Authentication status can be read from a global context or local storage

Affected Packages

web

Designs / Mockups (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwebFrontend Web app related issues

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions