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

UserContextValues's userRole in App now uses backend api to get user's role #164

Merged
merged 3 commits into from
Sep 16, 2020

Conversation

thai-truong
Copy link
Collaborator

It used to get the roles from firebase custom claims.

@thai-truong thai-truong added the enhancement New feature or request label Sep 15, 2020
@thai-truong thai-truong requested a review from a team September 15, 2020 06:17
@thai-truong thai-truong self-assigned this Sep 15, 2020
@netlify
Copy link

netlify bot commented Sep 15, 2020

Deploy preview for hknucsd-portal-dev ready!

Built with commit e1bf9a0

https://deploy-preview-164--hknucsd-portal-dev.netlify.app

@thai-truong
Copy link
Collaborator Author

Lmao since this needs the auth page refresh bug fix + legit test accounts the cypress literally cannot pass : (

@thai-truong
Copy link
Collaborator Author

Or well it needs the TODOs that I put in as comments at least. I left the TODOs there bc I thouht you'd have to do smth like that for the auth page refresh bug fix @godwinpang. Let me know if that is or isn't the case. If it isn't, I'll do the TODOs myself.

// TODO: Add ApiConfigStore.setToken(token || '') here so getUserRole() works

const id = parseInt(claims.user_id, 10);
const userRole = await getUserRole(id);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't await on both here - make them promises and do a promise.all - i want both awaits to go out together

Thai and others added 2 commits September 15, 2020 12:45
…s role.

It used to get the roles from firebase custom claims.
@thai-truong thai-truong merged commit 31d327f into dev Sep 16, 2020
@thai-truong thai-truong linked an issue Sep 19, 2020 that may be closed by this pull request
godwinpang added a commit that referenced this pull request Sep 20, 2020
…s role (#164)

* UserContextValues's userRole in App now uses backend api to get user's role.

It used to get the roles from firebase custom claims.

* Add fixes.

* Remove unused function.

Co-authored-by: gypang <[email protected]>
@godwinpang godwinpang deleted the rbac_query_roles branch September 20, 2020 22:09
@thai-truong thai-truong linked an issue Sep 27, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update frontend to use roles for RBAC
2 participants