0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-03 21:48:55 -05:00

refactor(core): align role_names claim with DB (#1016)

This commit is contained in:
Gao Sun 2022-06-01 15:43:16 +08:00 committed by GitHub
parent 9f68a7a124
commit 8a52c84e32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@ export default async function initOidc(app: Koa): Promise<Provider> {
ctx.request.origin === origin || isOriginAllowed(origin, client.metadata()),
// https://github.com/panva/node-oidc-provider/blob/main/recipes/claim_configuration.md
claims: {
profile: ['username', 'name', 'avatar', 'roles'],
profile: ['username', 'name', 'avatar', 'role_names', 'custom_data'],
},
// https://github.com/panva/node-oidc-provider/tree/main/docs#findaccount
findAccount: async (_ctx, sub) => {
@ -102,7 +102,7 @@ export default async function initOidc(app: Koa): Promise<Provider> {
username,
name,
avatar,
roles: roleNames,
roleNames,
...(use === 'userinfo' && { customData }),
});
},