diff --git a/Shogi.Api/appsettings.json b/Shogi.Api/appsettings.json
index bee5e44..b4da000 100644
--- a/Shogi.Api/appsettings.json
+++ b/Shogi.Api/appsettings.json
@@ -15,7 +15,8 @@
"Instance": "https://login.microsoftonline.com/",
"TenantId": "common",
"ClientId": "c1e94676-cab0-42ba-8b6c-9532b8486fff",
- "SwaggerUIClientId": "26bf69a4-2af8-4711-bf5b-79f75e20b082"
+ "SwaggerUIClientId": "26bf69a4-2af8-4711-bf5b-79f75e20b082",
+ "Scope": "api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope"
},
"Cors": {
"AllowedOrigins": [
diff --git a/Shogi.Domain/Aggregates/Session.cs b/Shogi.Domain/Aggregates/Session.cs
index a48bca2..6ba0e35 100644
--- a/Shogi.Domain/Aggregates/Session.cs
+++ b/Shogi.Domain/Aggregates/Session.cs
@@ -14,11 +14,14 @@ public class Session
}
public string Name { get; }
+
public ShogiBoard Board { get; }
+
///
/// The User.Id of the player which created the session.
///
public string Player1 { get; }
+
///
/// The User.Id of the second player.
///
diff --git a/Shogi.UI/Pages/Home/Account/AccountManager.cs b/Shogi.UI/Pages/Home/Account/AccountManager.cs
index ec98ea3..9ec7ec6 100644
--- a/Shogi.UI/Pages/Home/Account/AccountManager.cs
+++ b/Shogi.UI/Pages/Home/Account/AccountManager.cs
@@ -10,7 +10,6 @@ public class AccountManager
{
private readonly AccountState accountState;
private readonly IShogiApi shogiApi;
- private readonly IConfiguration configuration;
private readonly ILocalStorage localStorage;
private readonly AuthenticationStateProvider authState;
private readonly NavigationManager navigation;
@@ -19,7 +18,6 @@ public class AccountManager
public AccountManager(
AccountState accountState,
IShogiApi unauthenticatedClient,
- IConfiguration configuration,
AuthenticationStateProvider authState,
ILocalStorage localStorage,
NavigationManager navigation,
@@ -27,15 +25,12 @@ public class AccountManager
{
this.accountState = accountState;
this.shogiApi = unauthenticatedClient;
- this.configuration = configuration;
this.authState = authState;
this.localStorage = localStorage;
this.navigation = navigation;
this.shogiSocket = shogiSocket;
}
- private User? MyUser => accountState.User;
-
private Task SetUser(User user) => accountState.SetUser(user);
diff --git a/Shogi.UI/Pages/Home/Api/MsalMessageHandler.cs b/Shogi.UI/Pages/Home/Api/MsalMessageHandler.cs
index d91861c..fe6ad64 100644
--- a/Shogi.UI/Pages/Home/Api/MsalMessageHandler.cs
+++ b/Shogi.UI/Pages/Home/Api/MsalMessageHandler.cs
@@ -3,19 +3,21 @@ using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
namespace Shogi.UI.Pages.Home.Api
{
- public class MsalMessageHandler : AuthorizationMessageHandler
- {
- public MsalMessageHandler(IAccessTokenProvider provider, NavigationManager navigation) : base(provider, navigation)
- {
- ConfigureHandler(
- authorizedUrls: new[] { "https://api.lucaserver.space", "https://localhost:5001" },
- scopes: new[] { "api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope" },
- returnUrl: "https://localhost:3000");
- }
+ public class MsalMessageHandler : AuthorizationMessageHandler
+ {
+ public MsalMessageHandler(IAccessTokenProvider provider, NavigationManager navigation) : base(provider, navigation)
+ {
+ ConfigureHandler(
+ authorizedUrls: new[] { "https://api.lucaserver.space/Shogi.Api", "https://localhost:5001" },
+ scopes: new string[] {
+ "api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope",
+ "offline_access",
+ });
+ }
- protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
- {
- return base.SendAsync(request, cancellationToken);
- }
- }
+ protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ return base.SendAsync(request, cancellationToken);
+ }
+ }
}
diff --git a/Shogi.UI/Pages/Home/PageHeader.razor b/Shogi.UI/Pages/Home/PageHeader.razor
index 5a9a96d..49b4839 100644
--- a/Shogi.UI/Pages/Home/PageHeader.razor
+++ b/Shogi.UI/Pages/Home/PageHeader.razor
@@ -3,7 +3,11 @@