UNPKG

oidc-provider

Version:

OAuth 2.0 Authorization Server implementation for Node.js with OpenID Connect

16 lines (12 loc) 398 B
import instance from '../../helpers/weak_cache.js'; /* * Loads the End-User's account referenced by the session. */ export default async function loadAccount(ctx, next) { const { accountId } = ctx.oidc.session; if (accountId) { const account = await instance(ctx.oidc.provider).configuration.findAccount(ctx, accountId); ctx.oidc.entity('Account', account); } return next(); }