private async Task SIGNINASYNC(APPLICATIONUSER user, bool isPersistent) { try { string INFO = ("Iniciando Método SIGNINASYNC, USUARIO : " + user); log.Info("CODIGO : CTRCU4," + INFO); Thread HILO = new Thread(() => TRAZA.DEPURAR_TRAZA("CTRCU3", log.Logger.Name, "SIGNINASYNC", INFO)); HILO.Start(); AUTHENTICATIONMANAGER.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AUTHENTICATIONMANAGER.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); } catch (Exception ex) { log.ErrorFormat("CODIGO : CTRCU4, Método SIGNINASYNC, USUARIO : {0}, {1}", user, ex.StackTrace); ex.HelpLink = (ex.HelpLink == "" || ex.HelpLink == null ? "CTRCU4" : ex.HelpLink); Thread HILO = new Thread(() => ERROR.ERROR_TRAZA(ex.HelpLink, log.Logger.Name, ex.TargetSite.Name, ex.StackTrace)); HILO.Start(); throw ex; } }
public ActionResult SALIR() { try { string INFO = ("Iniciando Método SALIR"); log.Info("CODIGO : CTRCU5," + INFO); Thread HILO = new Thread(() => TRAZA.DEPURAR_TRAZA("CTRCU5", log.Logger.Name, "SALIR", INFO)); HILO.Start(); AUTHENTICATIONMANAGER.SignOut(); return(RedirectToAction("VALIDAR", "CUENTA")); } catch (Exception ex) { log.ErrorFormat("CODIGO : CTRCU5, Método SALIR, {0}", ex.StackTrace); ex.HelpLink = (ex.HelpLink == "" || ex.HelpLink == null ? "CTRCU5" : ex.HelpLink); Thread HILO = new Thread(() => ERROR.ERROR_TRAZA(ex.HelpLink, log.Logger.Name, ex.TargetSite.Name, ex.StackTrace)); HILO.Start(); throw ex; } }