0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00

fix(core): revert add custom claims to id token (#919)

This reverts commit 9ccda932a4.
This commit is contained in:
Xiao Yijun 2022-05-22 11:33:13 +08:00 committed by GitHub
parent 207c404aeb
commit fe99928a41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,20 +84,19 @@ export default async function initOidc(app: Koa): Promise<Provider> {
},
// 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: {