0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

chore: add comments

This commit is contained in:
Darcy Ye 2024-03-20 14:35:08 +08:00
parent e5e378d1bb
commit a2f20df9c9
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610

View file

@ -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);