From 15460eafb7aeff0447ab07085156b60707e0d49f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Thu, 24 Oct 2019 22:19:13 -0400 Subject: [PATCH] fix logout issue introduced when logging was added --- Oqtane.Client/Services/Interfaces/IUserService.cs | 2 +- Oqtane.Client/Services/UserService.cs | 4 ++-- Oqtane.Client/Themes/Controls/Login.razor | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Oqtane.Client/Services/Interfaces/IUserService.cs b/Oqtane.Client/Services/Interfaces/IUserService.cs index 700d2aeb..cb643489 100644 --- a/Oqtane.Client/Services/Interfaces/IUserService.cs +++ b/Oqtane.Client/Services/Interfaces/IUserService.cs @@ -22,6 +22,6 @@ namespace Oqtane.Services Task LoginUserAsync(User User, bool SetCookie, bool IsPersistent); - Task LogoutUserAsync(); + Task LogoutUserAsync(User User); } } diff --git a/Oqtane.Client/Services/UserService.cs b/Oqtane.Client/Services/UserService.cs index 19670a1b..f503a0bd 100644 --- a/Oqtane.Client/Services/UserService.cs +++ b/Oqtane.Client/Services/UserService.cs @@ -81,10 +81,10 @@ namespace Oqtane.Services return await http.PostJsonAsync(apiurl + "/login?setcookie=" + SetCookie.ToString() + "&persistent =" + IsPersistent.ToString(), User); } - public async Task LogoutUserAsync() + public async Task LogoutUserAsync(User User) { // best practices recommend post is preferrable to get for logout - await http.PostJsonAsync(apiurl + "/logout", null); + await http.PostJsonAsync(apiurl + "/logout", User); } } } diff --git a/Oqtane.Client/Themes/Controls/Login.razor b/Oqtane.Client/Themes/Controls/Login.razor index 5fff0e68..b40e93c4 100644 --- a/Oqtane.Client/Themes/Controls/Login.razor +++ b/Oqtane.Client/Themes/Controls/Login.razor @@ -31,7 +31,7 @@ private async Task LogoutUser() { - await UserService.LogoutUserAsync(); + await UserService.LogoutUserAsync(PageState.User); var authstateprovider = (IdentityAuthenticationStateProvider)ServiceProvider.GetService(typeof(IdentityAuthenticationStateProvider)); if (authstateprovider == null)