We’ve been using Netlify identity for a long time now, didn’t have any recent changes with that part; But starting from the day before yesterday new signups don’t have any roles set. Is there a problem with the service itself?
We’re setting the roles by using this snippet: (roles is an array of roles with the expected values → verified by a console.log before the return statement.)
I think I might be having a similar issue, my identity-signup function isn’t updating app_metadata anymore but it had been working flawlessly for years.
My temporary workaround using the same callback function (identity-signup) that normally returns the users metadata. To set the metadata, I’m calling the admin endpoint with the supplied auth token.
// BEGIN this is currently the only way to set roles
const identity = context.clientContext?.identity;
if (identity) {
return fetch(identity.url + "/admin/users/" + userInfo.id, {
method: "PUT",
body: JSON.stringify({
app_metadata: {
roles,
},
}),
headers: {
Authorization: "Bearer " + identity.token,
},
}).then(() => {
console.info("roles set", roles);
return {
statusCode: 200,
body: JSON.stringify({ app_metadata: { roles } }),
};
});
} else {
console.error("No identity in context", identity);
return {
statusCode: 500,
body: `There was an error signing up user ${dto.user.id} `,
};
}
// END this is currently the only way to set roles
Hi @Shadowmap sorry for the delay we just filed an escalation and our devs rolled out a fix yesterday evening! Are you still experiencing this issue? If so please let us know and I can escalate.