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:
parent
207c404aeb
commit
fe99928a41
1 changed files with 9 additions and 10 deletions
|
@ -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
|
// https://github.com/panva/node-oidc-provider/blob/main/recipes/client_based_origins.md
|
||||||
clientBasedCORS: (_, origin, client) => isOriginAllowed(origin, client.metadata()),
|
clientBasedCORS: (_, origin, client) => isOriginAllowed(origin, client.metadata()),
|
||||||
claims: {
|
|
||||||
openid: ['sub', 'name', 'avatar', 'custom_data'],
|
|
||||||
},
|
|
||||||
findAccount: async (ctx, sub) => {
|
findAccount: async (ctx, sub) => {
|
||||||
const { name, avatar, customData } = await findUserById(sub);
|
await findUserById(sub);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accountId: sub,
|
accountId: sub,
|
||||||
claims: async () => ({
|
claims: async (use, scope, claims, rejected) => {
|
||||||
sub,
|
console.log('use:', use);
|
||||||
name,
|
console.log('scope:', scope);
|
||||||
avatar,
|
console.log('claims:', claims);
|
||||||
custom_data: customData,
|
console.log('rejected:', rejected);
|
||||||
}),
|
|
||||||
|
return { sub };
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
ttl: {
|
ttl: {
|
||||||
|
|
Loading…
Reference in a new issue