mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
refactor(core): update comments
This commit is contained in:
parent
e5b7c1a6f0
commit
f985f2ae43
2 changed files with 8 additions and 3 deletions
|
@ -130,7 +130,8 @@ export const buildHandler: (
|
|||
}
|
||||
|
||||
/* === RFC 0001 === */
|
||||
// The params object may have the key with `undefined` value, so we have to use `Boolean` to check.
|
||||
// The value type is `unknown`, which will swallow other type inferences. So we have to cast it
|
||||
// to `Boolean` first.
|
||||
const organizationId = cond(Boolean(params.organization_id) && String(params.organization_id));
|
||||
if (organizationId) {
|
||||
// Validate if the refresh token has the required scope from RFC 0001.
|
||||
|
|
|
@ -18,7 +18,7 @@ import koaBody from 'koa-body';
|
|||
import Provider, { errors } from 'oidc-provider';
|
||||
import snakecaseKeys from 'snakecase-keys';
|
||||
|
||||
import type { EnvSet } from '#src/env-set/index.js';
|
||||
import { EnvSet } from '#src/env-set/index.js';
|
||||
import RequestError from '#src/errors/RequestError/index.js';
|
||||
import { addOidcEventListeners } from '#src/event-listeners/index.js';
|
||||
import koaAuditLog from '#src/middleware/koa-audit-log.js';
|
||||
|
@ -281,7 +281,11 @@ export default function initOidc(envSet: EnvSet, queries: Queries, libraries: Li
|
|||
});
|
||||
|
||||
addOidcEventListeners(oidc, queries);
|
||||
registerGrants(oidc, envSet, queries);
|
||||
|
||||
// DEV: Customized `refresh_token` grant
|
||||
if (EnvSet.values.isDevFeaturesEnabled) {
|
||||
registerGrants(oidc, envSet, queries);
|
||||
}
|
||||
|
||||
// Provide audit log context for event listeners
|
||||
oidc.use(koaAuditLog(queries));
|
||||
|
|
Loading…
Add table
Reference in a new issue