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 AdminProtectedRoute component #50

Closed prajjwalkapoor closed 3 weeks ago

prajjwalkapoor commented 1 year ago

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

Some routes like /admin/dashboard must not be accessed by the user except an admin. Design an AdminProtectedRoute component that will act as a wrapper to a page and redirect users to the home page if they don't have an admin role.

For Example:

<AdminProtectedRoute>
    <AdminDashboard />
</AdminProtectedRoute>

Task

Developer Help

You can refer to the last tear contributor's PR. Significant work has already been done there.

parthksingh1 commented 1 year ago

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

prajjwalkapoor commented 1 year ago

@parthksingh1 sure

bravichandra12 commented 3 weeks ago

@Pratik2026 I would like to work on this issue. I will create Admin Protected Route Component and will make sure to navigate it to home page if user is not admin

Pratik2026 commented 3 weeks ago

Sure @bravichandra12, you can start working on it.