Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: logout button logs out #81

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Server/Components/Pages/GamePage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@using Fracture.Server.Components.Pages
@using Fracture.Server.Modules.Shared
@using Fracture.Server.Modules.MapGenerator.UI
@using Microsoft.AspNetCore.Session
@layout GameLayout
@inject IUsersRepository UsersRepository
@inject NavigationManager NavigationManager
Expand Down Expand Up @@ -121,7 +122,7 @@
</div>
<div class="settingsBtn">
<div class="settingsBtn-content">
<img src="assets/exitbutton.svg" />
<div @onclick="@Logout"><img src="assets/exitbutton.svg" /></div>
</div>
</div>

Expand All @@ -137,7 +138,7 @@

private Dictionary<string, object> _equipmentPopupParameters = null!;
private Dictionary<string, object> _mapPopupParameters = null!;

private PopupContainer _popup = null!;
private string _loginInfo = string.Empty;

Expand Down Expand Up @@ -202,4 +203,10 @@

await base.OnInitializedAsync();
}

private void Logout ()
{
NavigationManager.NavigateTo("/home");
ProtectedSessionStore.DeleteAsync("username");
}
}
Loading