InviteMember roles as array

Hi in the docs it says we can set multiple roles in an invitation:
await authClient.organization.inviteMember({
role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})
await authClient.organization.inviteMember({
role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})
But when trying to do so I get error:
{
"code": "VALIDATION_ERROR",
"message": "Invalid body parameters"
}
{
"code": "VALIDATION_ERROR",
"message": "Invalid body parameters"
}
Types in the intellisense also says it has to be a string: const response = await authClient.organization.inviteMember({ email: parsedValue.email, role: parsedValue.roles, // Has to be string })
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?