https://selftaught-dev.com/ - happy-hugle-97373a
With Netlify Identity, is there a way to get the users role list if the only info I have is their account’s Netlify ID?
I’m using Stripe to process payments. After a user purchases a new product, Stripe calls the handle-webhooks.js function on Netlify so I can update the users role. I know I can use
fetch(`${identity.url}/admin/users/${netlifyID}`, {
method: "PUT",
headers: {
Authorization: `Bearer ${identity.token}`,
},
body: JSON.stringify({
app_metadata: {
roles: ["free"],
},
}),
})
to override the users role list, but I don’t want to override it, I want to append to it.