rishyym0927 / Affinity_frontend

Affinity is a web application designed to match individuals based on their intellectual compatibility. Users can create profiles, take quizzes, and find matches who share similar intellectual interests and capabilities. The project aims to foster meaningful connections through a sophisticated matching algorithm.
19 stars 36 forks source link

Integrate Role-Based Route Protection and redirect user to custom Denied Page for Unauthorized Access #15

Closed Anshul-Sharma01 closed 1 month ago

Anshul-Sharma01 commented 1 month ago

I would like to propose refactoring of the current route access logic by implementing a centralized RequireAuth component. This component will allow us to define role-based restrictions for specific routes and redirect unauthorized users to a denied page. Here’s what I plan to do:

This enhancement will improve maintainability and provide a cleaner approach to route access control.

I want to work under this issue for hacktoberfest, please assign this issue to me.

rishyym0927 commented 1 month ago

Hey, this is a great idea! However, we don't plan to implement role-based features in the project for now. We already have protected routing in place using context, so if you're interested in improving that, feel free to propose your workflow again with those adjustments. Let me know what you think!

Anshul-Sharma01 commented 1 month ago

Okk then for now can I just make a denied page for inaccessible routes for a particular user and would see if i can improve your current implementation of the route protection.

rishyym0927 commented 1 month ago

Okk then for now can I just make a denied page for inaccessible routes for a particular user and would see if i can improve your current implementation of the route protection.

Absolutely, feel free to create a new issue along with your proposed workflow. I recommend focusing on one specific task at a time, as multiple changes will still count as a single pull request. By concentrating on smaller features and documenting each as a separate issue, you can effectively streamline your contributions.