Skip to content

Implement Protected Route for Checkout Page. #37

@GauriKolte-02

Description

@GauriKolte-02

Issue: The /checkout route is currently accessible to all users, even if they're not logged in. This can lead to UI issues or errors if user data isn’t available.

Cause: There is no logic in the frontend to prevent unauthenticated access to protected routes.

Fix:
Use a higher-order component (HOC) or wrapper logic to check if the user is authenticated (e.g., by verifying a token or a logged-in flag in local storage/context).

If not authenticated, redirect to /login with a toast or alert.

Optionally, preserve the redirectTo path so user is taken to checkout after login.

Benefits:
Secures the payment flow and ensures only authenticated users can purchase courses.

I would like to work on this issue @ThakurAbhay9457 @hudazaan, please assign this to me.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions