Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add permissions for routes in frontend #637

Merged
merged 7 commits into from
Jul 14, 2023
Merged

add permissions for routes in frontend #637

merged 7 commits into from
Jul 14, 2023

Conversation

magsyg
Copy link
Contributor

@magsyg magsyg commented Jul 6, 2023

Added a ProtectedRoute, which takes in permissions, and returns the correct route if correct, if false it redirects to home or future 403 page.

Will add for rest of the admin routes, now only tested on gangs, at it seems to work

Still has a bug where it does not accept manual routes, because of useAuthContext takes time to load.
Should find a fix in routes for loading User

@magsyg magsyg requested review from emilte and evgiz as code owners July 6, 2023 19:13
frontend/src/AppRoutes.tsx Outdated Show resolved Hide resolved
frontend/src/AppRoutes.tsx Outdated Show resolved Hide resolved
frontend/src/AppRoutes.tsx Outdated Show resolved Hide resolved
frontend/src/AppRoutes.tsx Outdated Show resolved Hide resolved
frontend/src/AppRoutes.tsx Outdated Show resolved Hide resolved
@magsyg
Copy link
Contributor Author

magsyg commented Jul 7, 2023

La til slik at dersom man er logget inn så blir man redirected fra loginpage til homescreen, eller prøvd admin page dersom man prøvde seg dit

@magsyg magsyg merged commit e176691 into master Jul 14, 2023
@magsyg magsyg deleted the feature/permissions branch July 14, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants