failing to get user by email
❌Unsolved❓Question
public class FindUserUseCase(ZitadelProvider zitadelProvider)
{
public async Task<Result<Response>> FindUserByEmail(string email)
{
var value = new
{
queries = new[]
{
new
{
emailQuery = new
{
emailAddress = email,
method = "TEXT_QUERY_METHOD_EQUALS"
}
}
}
};
var http = await zitadelProvider.GetHttp();
var requestUri = "/v2/users";
var findUserByEmail = await http.PostAsJsonAsync(requestUri, value);
this is returning a serialization error
Result: IsSuccess='False', Reasons='Error with Message='SERIALIZATION.ERROR', Metadata='[exception, System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter
{
public async Task<Result<Response>> FindUserByEmail(string email)
{
var value = new
{
queries = new[]
{
new
{
emailQuery = new
{
emailAddress = email,
method = "TEXT_QUERY_METHOD_EQUALS"
}
}
}
};
var http = await zitadelProvider.GetHttp();
var requestUri = "/v2/users";
var findUserByEmail = await http.PostAsJsonAsync(requestUri, value);
this is returning a serialization error
Result: IsSuccess='False', Reasons='Error with Message='SERIALIZATION.ERROR', Metadata='[exception, System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan
1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Utf8JsonReader& reader, ReadStack& state)