Esempio n. 1
0
        public ActionResult LoginOut(string callbackUrl)
        {
            string token = System.Web.HttpContext.Current.User.Identity.Name;

            if (string.IsNullOrEmpty(token))
            {
                token = WebAuth.GetToken();
            }
            if (!string.IsNullOrEmpty(token))
            {
                //clear token
            }
            RemoveSessionInCookie();
            FormsAuthentication.SignOut();

            if (string.IsNullOrEmpty(callbackUrl))
            {
                return(Redirect(nameof(Login)));
            }
            else
            {
                return(RedirectToAction(nameof(Login), new { callbackUrl = callbackUrl }));
            }
        }