Checklist
Description
We've set up a database connection with optional emails using the Flexible Identifiers and Attributes features. When using the .NET SDK to try to remove a user's email, I haven't been able to get it to work correctly.
When using the API directly, you can set the email property to null, which will cause the field to be removed from the user. However, when we call the .NET SDK and set the Email property to null, that causes the SDK to omit the property from the request, which results in the field being unchanged on the user.
We alternatively tried setting the Email property to the empty string "", but that resulted in an error.
{
"statusCode": 400,
"error": "Bad Request",
"message": "Payload validation error: 'Object didn't pass validation for format email: ' on property email (Email address of this user).",
"errorCode": "invalid_body"
}
I do not necessarily want to change the behavior of sending null using the SDK since "leaving a property unchanged" is a useful feature to support patching an existing user. However, with null being used for that purpose and the empty string producing an error from the API, I am not sure how you should remove a user's email.
Reproduction
- Create a database connection
- Make email optional for users
- Create a user on that connection with some email
- Set up a .NET project using the Auth0 .NET SDK
- Use the SDK to make a user update request with
Email set to null
- Observe email is unchanged (reasonable result, but means I cannot remove the email)
Additional context
No response
auth0.net version
7.39.0
.NET version
8
Checklist
Description
We've set up a database connection with optional emails using the Flexible Identifiers and Attributes features. When using the .NET SDK to try to remove a user's email, I haven't been able to get it to work correctly.
When using the API directly, you can set the
emailproperty tonull, which will cause the field to be removed from the user. However, when we call the .NET SDK and set theEmailproperty tonull, that causes the SDK to omit the property from the request, which results in the field being unchanged on the user.We alternatively tried setting the
Emailproperty to the empty string"", but that resulted in an error.{ "statusCode": 400, "error": "Bad Request", "message": "Payload validation error: 'Object didn't pass validation for format email: ' on property email (Email address of this user).", "errorCode": "invalid_body" }I do not necessarily want to change the behavior of sending
nullusing the SDK since "leaving a property unchanged" is a useful feature to support patching an existing user. However, withnullbeing used for that purpose and the empty string producing an error from the API, I am not sure how you should remove a user's email.Reproduction
Emailset tonullAdditional context
No response
auth0.net version
7.39.0
.NET version
8