Skip to content

[Bug]: Cart page is accessible without user authentication #531

@DishaL17

Description

@DishaL17

Description

The Cart page can currently be accessed without user authentication. Users who have not logged in are still able to navigate to the Cart page through the navigation bar, which bypasses the expected authentication flow.

Since the Cart is intended to store and manage user-specific items before checkout, unauthenticated users should not be able to access this page directly.

Current Behavior

  • The Cart page is accessible without logging in.
  • Users can navigate to the Cart page directly from the navigation menu while unauthenticated.
  • No authentication check or redirection is performed.

Expected Behavior

  • Unauthenticated users should be redirected to the Login page when attempting to access the Cart page.
  • The Cart page should only be available after successful user authentication.
  • Appropriate route protection should be implemented for restricted pages.

Steps to Reproduce

  1. Open the application.
  2. Navigate to the Login page.
  3. Do not enter any credentials.
  4. Click on the "Cart" option in the navigation bar.
  5. Observe that the Cart page opens successfully without requiring authentication.

Impact

This behavior allows users to access a restricted user-specific page without authentication, resulting in an inconsistent user flow and potential access-control concerns.

Suggested Fix

Add authentication checks before rendering the Cart page and redirect unauthenticated users to the Login page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions