Skip to content

Commit

Permalink
Add nulltable reference type authgear#43
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed Jun 1, 2022
1 parent eed1ce6 commit a810898
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Authgear.Xamarin/Data/JsonDescriptionEnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial
return value;
}
}
return default;
// TODO: Investigate how to do it properly without !
return default!;
}

public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Expand Down
8 changes: 4 additions & 4 deletions Authgear.Xamarin/Data/Oauth/OauthRepoHttp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public async Task<AppSessionTokenResponse> OauthAppSessionTokenAsync(string refr
["refresh_token"] = refreshToken,
};
var content = new StringContent(JsonSerializer.Serialize(body), Encoding.UTF8, "application/json");
var responseMessage = await httpClient.PostAsync(new Uri(new Uri(Endpoint), "/oauth2/app_session_token"), content);
var result = await responseMessage.GetJsonAsync<AppSessionTokenResponseResult>();
var responseMessage = await httpClient.PostAsync(new Uri(new Uri(Endpoint), "/oauth2/app_session_token"), content).ConfigureAwait(false);
var result = await responseMessage.GetJsonAsync<AppSessionTokenResponseResult>().ConfigureAwait(false);
return result.Result!;
}

Expand All @@ -83,8 +83,8 @@ public async Task<ChallengeResponse> OauthChallengeAsync(string purpose)
["purpose"] = purpose
};
var content = new StringContent(JsonSerializer.Serialize(body), Encoding.UTF8, "application/json");
var responseMessage = await httpClient.PostAsync(new Uri(new Uri(Endpoint), "/oauth2/challenge"), content);
var result = await responseMessage.GetJsonAsync<ChallengeResponseResult>();
var responseMessage = await httpClient.PostAsync(new Uri(new Uri(Endpoint), "/oauth2/challenge"), content).ConfigureAwait(false);
var result = await responseMessage.GetJsonAsync<ChallengeResponseResult>().ConfigureAwait(false);
return result.Result!;
}

Expand Down
4 changes: 2 additions & 2 deletions Authgear.Xamarin/UserInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class UserInfo
[JsonPropertyName("sub")]
public string Sub { get; set; } = "";
[JsonPropertyName("https://authgear.com/claims/user/is_anonymous")]
public bool IsAnonymous { get; set; }
public bool? IsAnonymous { get; set; }
[JsonPropertyName("https://authgear.com/claims/user/is_verified")]
public bool IsVerified { get; set; }
public bool? IsVerified { get; set; }
}
}

0 comments on commit a810898

Please sign in to comment.