Fix claims.
Use OID instead of email for microsoft identifier. Fix PlayerCount route. Add created date to user table. Create spectator icon.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Shogi.Contracts.Api;
|
||||
using Shogi.Contracts.Types;
|
||||
using Shogi.UI.Pages.Home.Account;
|
||||
using System.Net;
|
||||
|
||||
namespace Shogi.UI.Pages.Home.Api;
|
||||
@@ -8,7 +9,7 @@ public interface IShogiApi
|
||||
{
|
||||
Task<Session?> GetSession(string name);
|
||||
Task<ReadSessionsPlayerCountResponse?> GetSessionsPlayerCount();
|
||||
Task<CreateTokenResponse?> GetToken();
|
||||
Task<CreateTokenResponse?> GetToken(WhichAccountPlatform whichAccountPlatform);
|
||||
Task GuestLogout();
|
||||
Task Move(string sessionName, MovePieceCommand move);
|
||||
Task<HttpStatusCode> PostSession(string name, bool isPrivate);
|
||||
|
||||
@@ -57,10 +57,12 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<CreateTokenResponse?> GetToken()
|
||||
public async Task<CreateTokenResponse?> GetToken(WhichAccountPlatform whichAccountPlatform)
|
||||
{
|
||||
Console.WriteLine($"GetToken() - {accountState.User?.WhichAccountPlatform}");
|
||||
var response = await HttpClient.GetFromJsonAsync<CreateTokenResponse>(new Uri("User/Token", UriKind.Relative), serializerOptions);
|
||||
var httpClient = whichAccountPlatform == WhichAccountPlatform.Microsoft
|
||||
? clientFactory.CreateClient(MsalClientName)
|
||||
: clientFactory.CreateClient(GuestClientName);
|
||||
var response = await httpClient.GetFromJsonAsync<CreateTokenResponse>(new Uri("User/Token", UriKind.Relative), serializerOptions);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user