-
Notifications
You must be signed in to change notification settings - Fork 14
Add user roles support
#82
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
Conversation
Greptile OverviewGreptile SummaryThis PR adds support for multiple user Key changes:
The implementation is clean, consistent with the existing codebase patterns, and properly handles both the presence and absence of the Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant authkitLoader
participant getClaimsFromAccessToken
participant JWT
participant Session
Client->>authkitLoader: Request with session cookie
authkitLoader->>Session: getSessionFromCookie()
Session-->>authkitLoader: Session with accessToken
authkitLoader->>getClaimsFromAccessToken: Extract claims from JWT
getClaimsFromAccessToken->>JWT: decodeJwt(accessToken)
JWT-->>getClaimsFromAccessToken: {sid, org_id, role, roles, permissions, entitlements}
getClaimsFromAccessToken-->>authkitLoader: Claims with roles array
authkitLoader->>authkitLoader: Build AuthorizedData with roles
authkitLoader-->>Client: {user, role, roles, permissions, ...}
|
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.
5 files reviewed, no comments
nicknisi
left a comment
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.
This looks good! Since Remix is being succeeded by React Router, we'll want to make this change there as well. https://github.com/workos/authkit-react-router
|
Okay great, will make a follow up ticket! |
17f64c5 to
9592ec9
Compare
9592ec9 to
b64b6ac
Compare
|
@nicknisi took a look and it seems this is already supported in the authkit-react-router package. We must have missed remix during initial multiple roles launch. |
For multiple user roles in the session jwt.