public virtual async Task <ActionResult> SignOut([FromServices] IMemoryCacheProvider cacheProvider) { if (User.Identity.IsAuthenticated) { cacheProvider.Remove(GlobalVariables.CacheSettings.MenuModelCacheKey(User.GetUserId())); cacheProvider.Remove(GlobalVariables.CacheSettings.MainMenuCacheKey(User.GetUserId())); await _httpAccessor.HttpContext.SignOutAsync(); } return(RedirectToAction("SignIn")); }
public virtual async Task <JsonResult> Update(int id) { ViewBag.Actions = GetActions(); var findRep = await _actionSrv.FindAsync(id); if (!findRep.IsSuccessful) { return(Json(new Response <string> { IsSuccessful = false, Message = Strings.RecordNotFound.Fill(DomainString.Action) })); } _cache.Remove(CacheSettings.MenuModelCacheKey(User.GetUserId())); return(Json(new Modal { Title = $"{Strings.Update} {DomainString.Action}", AutoSubmitBtnText = Strings.Edit, Body = await ControllerExtension.RenderViewToStringAsync(this, "Partials/_Entity", findRep.Result), AutoSubmit = false })); }
public void SignOut(Guid userId) { _cache.Remove(MenuModelCacheKey(userId)); }