Merge pull request #158 from sbwalker/master

fix logout issue introduced when logging was added
This commit is contained in:
Shaun Walker 2019-10-24 22:20:05 -04:00 committed by GitHub
commit 59c7af4fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -22,6 +22,6 @@ namespace Oqtane.Services
Task<User> LoginUserAsync(User User, bool SetCookie, bool IsPersistent); Task<User> LoginUserAsync(User User, bool SetCookie, bool IsPersistent);
Task LogoutUserAsync(); Task LogoutUserAsync(User User);
} }
} }

View File

@ -81,10 +81,10 @@ namespace Oqtane.Services
return await http.PostJsonAsync<User>(apiurl + "/login?setcookie=" + SetCookie.ToString() + "&persistent =" + IsPersistent.ToString(), User); return await http.PostJsonAsync<User>(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 // best practices recommend post is preferrable to get for logout
await http.PostJsonAsync(apiurl + "/logout", null); await http.PostJsonAsync(apiurl + "/logout", User);
} }
} }
} }

View File

@ -31,7 +31,7 @@
private async Task LogoutUser() private async Task LogoutUser()
{ {
await UserService.LogoutUserAsync(); await UserService.LogoutUserAsync(PageState.User);
var authstateprovider = (IdentityAuthenticationStateProvider)ServiceProvider.GetService(typeof(IdentityAuthenticationStateProvider)); var authstateprovider = (IdentityAuthenticationStateProvider)ServiceProvider.GetService(typeof(IdentityAuthenticationStateProvider));
if (authstateprovider == null) if (authstateprovider == null)