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)