-
Notifications
You must be signed in to change notification settings - Fork 26
Description
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.