for anyone else wondering, after you set additional claims to id token,
at least for discord, they are put under ext_provider
Next.js SDK (app router) example:const { getIdToken } = getKindeServerSession();
const idToken = await getIdToken();
const externalProvider = idToken.ext_provider;
console.log(externalProvider)
/* Example output:
{
"claims": {
"is_confirmed": true,
"profile": {
"accent_color": 16711680,
"avatar": "https://example.com/avatar.jpg",
"banner_color": "#00FF00",
"discriminator": "1234",
"email": "example@example.com",
"flags": 128,
"global_name": "Example User",
"id": "123456789012345678",
"locale": "en-US",
"mfa_enabled": true,
"premium_type": 1,
"public_flags": 64,
"username": "exampleuser",
"verified": true
}
}
}
*/