bsoc-bitbyte / busify

A centralised bus ticket booking system that will allow the students to book tickets in advance through an online website, saving time and effort.
https://busify.vercel.app
30 stars 67 forks source link

Create a UserProtectedRoute component #49

Closed prajjwalkapoor closed 12 months ago

prajjwalkapoor commented 1 year ago

Is your feature request related to a problem? Please describe.

Some routes like /checkout should be protected if the user is not logged in. Design a component that will act as a wrapper to a page and redirects users to the home page if they are not logged in.

For Example:

<UserProtectedRoute>
    <Checkout />
</UserProtectedRoute>

Describe the solution you'd like

NA

Describe alternatives you've considered

No response

Developer Help

No response

Pratik2026 commented 1 year ago

I would like to work on this issue. I will simply create a userProtectedRoute component which will redirect the user to home page if they are not logged in otherwise rendered the wrapped Component .

prajjwalkapoor commented 1 year ago

@Pratik2026 sure