Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darcyYe committed Mar 20, 2024
1 parent e5e378d commit a2f20df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/libraries/jwt-customizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export const createJwtCustomizerLibrary = (
const { findUserRoles } = userLibrary;
const { attachResourceToScopes } = scopeLibrary;

/**
* We does not include org roles' scopes for the following reason:
* 1. The org scopes query method requires `limit` and `offset` parameters. Other management API get
* these APIs from console setup while this library method is a backend used method.
* 2. Logto developers can get the org roles' id from this user context and hence query the org roles' scopes via management API.
*/
const getUserContext = async (userId: string): Promise<JwtCustomizerUserContext> => {
const user = await findUserById(userId);
const fullSsoIdentities = await userSsoIdentities.findUserSsoIdentitiesByUserId(userId);
Expand Down

0 comments on commit a2f20df

Please sign in to comment.