diff --git a/LANCommander/Areas/Identity/Pages/Account/Logout.cshtml.cs b/LANCommander/Areas/Identity/Pages/Account/Logout.cshtml.cs index 7f0d4f7..dff342e 100644 --- a/LANCommander/Areas/Identity/Pages/Account/Logout.cshtml.cs +++ b/LANCommander/Areas/Identity/Pages/Account/Logout.cshtml.cs @@ -15,49 +15,20 @@ namespace LANCommander.Areas.Identity.Pages.Account { public class LogoutModel : PageModel { - private readonly SignInManager _signInManager; - private readonly ILogger _logger; + private readonly SignInManager SignInManager; + private readonly ILogger Logger; public LogoutModel(SignInManager signInManager, ILogger logger) { - _signInManager = signInManager; - _logger = logger; + SignInManager = signInManager; + Logger = logger; } - public async Task OnGet(string returnUrl = null, bool force = false) + public async Task OnGet() { - if (force) - { - await _signInManager.SignOutAsync(); - _logger.LogInformation("User logged out."); + await SignInManager.SignOutAsync(); - if (returnUrl != null) - { - return LocalRedirect(returnUrl); - } - else - { - return LocalRedirect("/Identity/Account/Login"); - } - } - - return Page(); - } - - public async Task OnPost(string returnUrl = null) - { - await _signInManager.SignOutAsync(); - _logger.LogInformation("User logged out."); - if (returnUrl != null) - { - return LocalRedirect(returnUrl); - } - else - { - // This needs to be a redirect so that the browser performs a new - // request and the identity for the user gets updated. - return RedirectToPage(); - } + return LocalRedirect("/"); } } } diff --git a/LANCommander/Pages/Profile/Index.razor b/LANCommander/Pages/Profile/Index.razor index 3595885..db997bc 100644 --- a/LANCommander/Pages/Profile/Index.razor +++ b/LANCommander/Pages/Profile/Index.razor @@ -1,4 +1,5 @@ @page "/Profile" +@page "/Profile/General" @using Microsoft.AspNetCore.Components.Authorization; @layout ProfileLayout @inject UserManager UserManager diff --git a/LANCommander/Shared/MainLayout.razor b/LANCommander/Shared/MainLayout.razor index 6ca27e9..78ed5fe 100644 --- a/LANCommander/Shared/MainLayout.razor +++ b/LANCommander/Shared/MainLayout.razor @@ -12,9 +12,24 @@ Redistributables Servers Files - Settings + + General + Users + Authentication + User Saves + Archives + Media + IPX Relay + Beacon + Tools + } - Profile + + General + Change Password + Saves + Logout +