From fe99928a41e1987f7fd078b711c9a0bb2c86e5c9 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Sun, 22 May 2022 11:33:13 +0800 Subject: [PATCH] fix(core): revert add custom claims to id token (#919) This reverts commit 9ccda932a45816be2089d3e58c8e91f55b9ecce9. --- packages/core/src/oidc/init.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/core/src/oidc/init.ts b/packages/core/src/oidc/init.ts index 0eef48293..ab7203f72 100644 --- a/packages/core/src/oidc/init.ts +++ b/packages/core/src/oidc/init.ts @@ -84,20 +84,19 @@ export default async function initOidc(app: Koa): Promise { }, // https://github.com/panva/node-oidc-provider/blob/main/recipes/client_based_origins.md clientBasedCORS: (_, origin, client) => isOriginAllowed(origin, client.metadata()), - claims: { - openid: ['sub', 'name', 'avatar', 'custom_data'], - }, findAccount: async (ctx, sub) => { - const { name, avatar, customData } = await findUserById(sub); + await findUserById(sub); return { accountId: sub, - claims: async () => ({ - sub, - name, - avatar, - custom_data: customData, - }), + claims: async (use, scope, claims, rejected) => { + console.log('use:', use); + console.log('scope:', scope); + console.log('claims:', claims); + console.log('rejected:', rejected); + + return { sub }; + }, }; }, ttl: {