I use Netlify identity.
I created identity-signup function and return the following response from it:
const handler = async (event: Event, context: Context) => {
return {
statusCode: 200,
body: { "user_metadata": { "roles": ["customer"] } },
headers: {
'content-type': 'text/html',
'cache-control': 'no-cache'
}
};
}
module.exports = { handler }
When I do sign up and then confirm the email I’m getting this error:
I tried changing the function’s response to
{ "app_metadata": { "roles": ["customer"] } }
But still having the same error.
When I look at the backend - I see the user is created, but has no roles attached to it.