Allow using sendSetPasswordEmail with user.data.email
Allow using sendSetPasswordEmail with user.data.email
Problem
I have a scenario where users have unique usernames but duplicated emails. In this case, I am unable to use the sendSetPasswordEmail option when creating a user because the user.email field is required with sendSetPasswordEmail. Since my users can have duplicated emails, I cannot use this field. Instead, I must use user.data.email for them. However, the sendSetPasswordEmail does not work with user.data.email.
Solution
Allow using user.data.email with sendSetPasswordEmail or include a new optional field when creating a user to specify the email for sending the setup password email.
This should work already. If it is not, you'll need provide some additional details of the workflow you are using so we can identify if there is a bug or perhaps we can help you adjust how you are using the APIs.
Thanks.
Basically is what I said, I set sendSetPasswordEmail=true, then I set the user.data.email but not the user.email when I create a user. This is the error:
{ "fieldErrors": { "user.email": [ { "code": "[required]user.email", "message": "You must specify the [user.email] property when [sendSetPasswordEmail] is equals to [true]." } ] }, "generalErrors": [] }
Looks like the validation check (validateUserCreate) doesn't look for user.data.email only user.email, when sendSetPasswordEmail is true.
The admin UI for creation of a new user will also need to be updated to account for this bug (I was not able to get this to work and received no error but was not allowed to create the user)