Ahhhhhh, this error is getting on my nerves: You must specify either the [user.email] or [user.username] property. If you are emailing the user you must specify the [user.email]
The thing is that I am setting the user's email to enable them login and then inside data object I am setting a username for the future use, but as of now it is kinda random and automatically generated at the registration time.
So why the heck is FusionAuth SDK for Typescript returns a client response with this error is a mystery for me.
It should not do it under normal circumstances, according to my understanding you can only use email or username, and I am setting email as the way to login but username is inside the data and that should not interfere with anything IMO.
I am trying to update this user that was created automatically with Terraform:
resource "fusionauth_user" "you-say-temp-user" {
tenant_id = fusionauth_tenant.you-say-tenant.id
email = "souma.kazuya@you-say.com"
first_name = "Souma"
last_name = "Kazuya"
password = "souma.kazuya"
skip_verification = true
password_change_required = false
data = jsonencode({
username : "souma_kazuya"
})
}
And here is the TS code that I am using to update it, as you can see I am not even touching username:
await this.fusionAuthClient.updateUser(id, {
user: {
lastName: updateUserInfoDto.lastName,
firstName: updateUserInfoDto.firstName,
},
});
It would be really great if someone could leave a comment setting myself aside ありがとう.