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

How to prevent users from changing their own roles? #13

Closed
drmcclelland opened this issue Jun 14, 2022 · 2 comments · Fixed by #14
Closed

How to prevent users from changing their own roles? #13

drmcclelland opened this issue Jun 14, 2022 · 2 comments · Fixed by #14
Assignees
Labels
bug Something isn't working

Comments

@drmcclelland
Copy link

I noticed that after logging in, I am able to use the Chrome Dev tools to change my role (example: GUEST to SUPER_ADMIN)... all I have to do is navigate to any thing in the app and it instantly shows me all the links on the navbar which are available to the new role I entered. What would be a good way to keep this from happening? I wouldn't want them to see any data or perform any actions that they aren't authorized for.

image

@JamesABA
Copy link

I get the feeling that the author intended developers to refactor in a 'proper' authentication module that handles this in a secure fashion, the example shows only how to structure your routes and role mapping.

Something like msal react could work if you're using AAD as an identity provider (https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react)

@umair-khanzada
Copy link
Owner

umair-khanzada commented Jun 22, 2022

Hey, @drmcclelland I'm so sorry for the super delay. actually, I was quite busy the previous week.
Thank you for reporting this issue, I have checked it and am able to reproduce it. I have created a PR for that if you still looking for a solution you must check the PR and let me know if have any confusion. Here is the PR

Screen Shot 2022-06-21 at 7 25 52 PM

@umair-khanzada umair-khanzada added the bug Something isn't working label Jun 22, 2022
@umair-khanzada umair-khanzada linked a pull request Jun 22, 2022 that will close this issue
@umair-khanzada umair-khanzada self-assigned this Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants