yep
This commit is contained in:
@@ -65,8 +65,16 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
var httpClient = whichAccountPlatform == WhichAccountPlatform.Microsoft
|
||||
? clientFactory.CreateClient(MsalClientName)
|
||||
: clientFactory.CreateClient(GuestClientName);
|
||||
var response = await httpClient.GetFromJsonAsync<CreateTokenResponse>(RelativeUri("User/Token"), serializerOptions);
|
||||
return response;
|
||||
var response = await httpClient.GetAsync(RelativeUri("User/Token"));
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
return await response.Content.ReadFromJsonAsync<CreateTokenResponse>(serializerOptions);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task Move(string sessionName, MovePieceCommand command)
|
||||
@@ -83,10 +91,9 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
return response.StatusCode;
|
||||
}
|
||||
|
||||
public async Task<HttpStatusCode> PatchJoinGame(string name)
|
||||
public Task<HttpResponseMessage> PatchJoinGame(string name)
|
||||
{
|
||||
var response = await HttpClient.PatchAsync(RelativeUri($"Sessions/{name}/Join"), null);
|
||||
return response.StatusCode;
|
||||
return HttpClient.PatchAsync(RelativeUri($"Sessions/{name}/Join"), null);
|
||||
}
|
||||
|
||||
private static Uri RelativeUri(string path) => new Uri(path, UriKind.Relative);
|
||||
|
||||
Reference in New Issue
Block a user