Replace custom socket implementation with SignalR.
Replace MSAL and custom cookie auth with Microsoft.Identity.EntityFramework Also some UI redesign to accommodate different login experience.
This commit is contained in:
30
Shogi.UI/Pages/Identity/LogoutPage.razor
Normal file
30
Shogi.UI/Pages/Identity/LogoutPage.razor
Normal file
@@ -0,0 +1,30 @@
|
||||
@page "/logout"
|
||||
@inject IAccountManagement Acct
|
||||
|
||||
<main class="PrimaryTheme">
|
||||
<h1>Logout</h1>
|
||||
|
||||
<AuthorizeView @ref="authView">
|
||||
<Authorized>
|
||||
<div class="alert alert-info">Logging you out...</div>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<p>Thanks for playing!</p>
|
||||
<div class="alert alert-success">You're logged out. <a href="/login">Log in.</a></div>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
</main>
|
||||
|
||||
@code {
|
||||
private AuthorizeView? authView;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (await Acct.CheckAuthenticatedAsync())
|
||||
{
|
||||
await Acct.LogoutAsync();
|
||||
}
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user