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:
2023-01-20 20:48:38 -06:00
parent 1d0beaf69f
commit 26fd955aa4
35 changed files with 672 additions and 1426 deletions

View File

@@ -74,13 +74,7 @@ public class SessionsController : ControllerBase
[HttpGet("PlayerCount")]
public async Task<ActionResult<ReadSessionsPlayerCountResponse>> GetSessionsPlayerCount()
{
var sessions = await this.queryRespository.ReadSessionPlayerCount();
return Ok(new ReadSessionsPlayerCountResponse
{
PlayerHasJoinedSessions = Array.Empty<SessionMetadata>(),
AllOtherSessions = sessions.ToList()
});
return Ok(await this.queryRespository.ReadSessionPlayerCount(this.User.GetShogiUserId()));
}
[HttpGet("{name}")]

View File

@@ -42,7 +42,7 @@ public class UserController : ControllerBase
public ActionResult<CreateTokenResponse> GetWebSocketToken()
{
var userId = User.GetShogiUserId();
var displayName = User.DisplayName();
var displayName = User.GetShogiUserDisplayname();
var token = tokenCache.GenerateToken(userId);
return new CreateTokenResponse
@@ -74,7 +74,7 @@ public class UserController : ControllerBase
{
var signOutTask = HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
var userId = User?.GetGuestUserId();
var userId = User?.GetShogiUserId();
if (!string.IsNullOrEmpty(userId))
{
connectionManager.Unsubscribe(userId);