Anti-Forgery Token was meant for a different claims-based user

前端 未结 7 1799
有刺的猬
有刺的猬 2020-12-28 13:41

I am working on a logout feature in the application we are using ASP.NET Identity login. I can login successfully but when I logout and then try to login again I get the fol

7条回答
  •  遥遥无期
    2020-12-28 14:22

    Try this:

     public ActionResult Login(string modelState = null)
        {
            if (modelState != null)
                ModelState.AddModelError("", modelState );
    
            return View();
        }
     [ValidateAntiForgeryToken]
        public async Task Login(LoginViewModel model)
        {
            AuthenticationManager.SignOut();
    
            return RedirectToAction("Login", "Controller", new { modelState = "MSG_USER_NOT_CONFIRMED" });
        }
    

提交回复
热议问题