System.ArgumentNullException: Value cannot be null when sending UserUpdateRequest with VerifyEmail = true for emails with a + sign
apereiratl opened this issue · 2 comments
apereiratl commented
Describe the problem
When using an email address for a user that has a + sign in it, we receive the following stack trrace:
{
"responseStatus": {
"errorCode": "ArgumentNullException",
"message": "Value cannot be null. (Parameter 'stringToEscape')",
"stackTrace": "[UserEmail: 5/11/2022 6:45:00 AM]:\n[REQUEST: {user:1208}]
\r\nSystem.ArgumentNullException: Value cannot be null. (Parameter 'stringToEscape')
\r\n at System.UriHelper.EscapeString(String stringToEscape, Boolean checkExistingEscaped, ReadOnlySpan`1 unreserved, Char forceEscape1, Char forceEscape2)
\r\n at System.Uri.EscapeDataString(String stringToEscape)
\r\n at Auth0.ManagementApi.Clients.BaseClient.EncodePath(String value)\r\n at Auth0.ManagementApi.Clients.UsersClient.UpdateAsync(String id, UserUpdateRequest request, CancellationToken cancellationToken)\r\n at ServiceInterface.Services.UserService.Put(UserEmail request) in C:\\projects\\productname\\ServiceInterface\\Services\\UserService.cs:line 304\r\n at ServiceStack.Host.ServiceRunner`1.ExecuteAsync(IRequest req, Object instance, TRequest requestDto) in C:\\BuildAgent\\work\\3481147c480f4a2f\\src\\ServiceStack\\Host\\ServiceRunner.cs:line 154\r\n",
"errors": [
{
"errorCode": "ArgumentNullException",
"fieldName": "stringToEscape",
"message": "Value cannot be null."
}
]
}
}
What was the expected behavior?
User should receive a verification request via email.
Reproduction
- Create a user with an email address that is of the format username+extrastuff@gmail.com.
- Request email verification for user.
Environment
- Auth0.ManagementApi: 7.16.0
- .NET Core 6
frederikprijck commented
Can you please show the snippet that causes this error, because the stacktrace leads to this: https://github.com/auth0/auth0.net/blob/master/src/Auth0.ManagementApi/Clients/UsersClient.cs#L308, more specifically: EncodePath(id)
, which is unrelated to the email address or whether it uses a +
.
frederikprijck commented
Closing as no feedback