Exception Thrown trying to GeneratePasswordResetToken

Hello,
I get an exception in AutoRest client when trying to Generate Password Reset Token:

Fails in class VirtoCommerce.Storefront.AutoRestClients.PlatformModuleApi.Security
Method public async Task<HttpOperationResponse<string>> GeneratePasswordResetTokenWithHttpMessagesAsync(string userId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))

Newtonsoft.Json.JsonReaderException
  HResult=0x80131500
  Message=Unexpected character encountered while parsing value: C. Path '', line 1, position 1.
  Source=Newtonsoft.Json
  StackTrace:
   at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ReadAsString()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
   at VirtoCommerce.Storefront.AutoRestClients.PlatformModuleApi.Security.<GeneratePasswordResetTokenWithHttpMessagesAsync>d__43.MoveNext() in C:\sherian\Market\src\virto\vc-storefront\VirtoCommerce.Storefront\AutoRestClients\PlatformModuleApi.cs:line 13431

  This exception was originally thrown at this call stack:
    [External Code]
    VirtoCommerce.Storefront.AutoRestClients.PlatformModuleApi.Security.GeneratePasswordResetTokenWithHttpMessagesAsync(string, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>, System.Threading.CancellationToken) in PlatformModuleApi.cs

I have bypassed this error by ignoring the attemp to serialse the returned token into a string: meaning;
when the response status code returned from Platform API is status-code 200
the response content is read as a string from the response stream on this line:

  • _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

I then avoid the attempt to desrialize this in the try/catch:

  • _result.Body = SafeJsonConvert.DeserializeObject<string>(_responseContent, Client.DeserializationSettings);

and I instead set the value to the result body directly, as in:

  • _result.Body = _requestContent;

This returns the result to the Controller, and I receive the email.

However, I am unsure how my UI should handle this? What is the expected workflow from here? A new Page providing new Password entry by the user?

Can you point to any theme that completes this process, that is not using GraphQL

@sherif Did you test API call in Swagger? Is it works on your environment?