-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat: Implement new role access #20
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other places which must be hidden as well, submission grading, question add, user add etc for spectators
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this and switch to pnpm
> | ||
Edit | ||
</Button> | ||
{localStorage.getItem("role") == "ADMIN" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not rely on localstorage for this and use the profile from RTK Query
src/components/users/user/index.jsx
Outdated
loading={isLoading} | ||
loaderProps={{ width: 16, height: 16 }} | ||
/> | ||
{localStorage.getItem("role") == "ADMIN" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not rely on localstorage for this and use the profile from RTK Query
src/store/api/auth.js
Outdated
@@ -20,6 +20,7 @@ export const authApi = createApi({ | |||
} else { | |||
localStorage.setItem("access_token", response.data.access_token); | |||
localStorage.setItem("refresh_token", response.data.refresh_token); | |||
localStorage.setItem("role", response.data.user.role); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this, we already have the user info with us in the access token which also is used to retrieve and set to the state
No description provided.