@Daniel_Kinde Thanks for your response. In order to use that endpoint we would need the current refresh_token right? According to KindeAI it seems like it's not possible to get the refresh_token.
https://discord.com/channels/1070212618549219328/1205662406446162020/1205682723411206205Here is what we are doing so far if you are interested. I think we are probably just going to settle for having a label saying the user needs to log out and log back in for the name to be updated.
const tokenResponse = await fetch(`${KINDE_ISSUER_URL}/oauth2/token`, {
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
audience: `${KINDE_ISSUER_URL}/api`,
grant_type: 'client_credentials',
client_id: KINDE_CLIENT_ID,
client_secret: KINDE_CLIENT_SECRET,
}),
});
const { access_token } = await tokenResponse.json();
await fetch(`${KINDE_ISSUER_URL}/api/v1/user?id=${user.id}`, {
method: 'PATCH',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${access_token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ given_name, family_name }),
});
await fetch(
`${KINDE_ISSUER_URL}/api/v1/users/${user.id}/refresh_claims`,
{
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${access_token}`,
},
}
);