public async Task <IActionResult> OnPost(string returnUrl = null) { await _signInManager.SignOutAsync(); _logger.LogInformation("User logged out."); // Clear out Cache var userId = User.GetLoggedInUserId <int>(); _layoutService.ReleaseCache(userId); if (returnUrl != null) { return(LocalRedirect(returnUrl)); } else { return(RedirectToPage()); } }