// Invitaciones public async Task <JsonResult> OnPostAcceptInvitation([FromBody] ParamGuests Invitado) { Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Confirmant = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); Invitado.Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Invitado.Person = User.Claims.Where(x => x.Type == "Owner").Select(x => x.Value).SingleOrDefault(); var token = HttpContext.Session.GetString("token"); var respuesta = await _peopleService.AcceptInvitation(Invitado, token); if (respuesta.Error == null) { var id = User.Claims.Where(x => x.Type == "Id").Select(x => x.Value).SingleOrDefault(); var l = await _aS.RefreshToken(id, CultureInfo.CurrentCulture.Name, Participant, token, Confirmant); if (l.Error == null) { HttpContext.Session.SetString("token", l.Token); } } if (respuesta.Error == null || respuesta.Error == "") { Participant = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault(); Owner = User.Claims.Where(x => x.Type == "Owner").Select(x => x.Value).SingleOrDefault(); Country = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault(); Discriminator = User.Claims.Where(x => x.Type == "Discriminator").Select(x => x.Value).SingleOrDefault(); TipoParticipante = Participant; registrarClienteTF.User = new User(); registrarClienteTF.Registrarse = new PesonProfile(); registrarClienteTF.User.Participant = Participant; registrarClienteTF.User.Discriminator = Discriminator; if (HttpContext.Session.GetString("CountryPerfil") == null || HttpContext.Session.GetString("CountryPerfil") == "null" || HttpContext.Session.GetString("CountryPerfil") == "") { registrarClienteTF.DataPaises = await _globalService.ConsultasAsociadosTF(new ParamCountry { Id = Int32.Parse(Request.Cookies["Country"]) }); HttpContext.Session.SetString("CountryPerfil", JsonConvert.SerializeObject(registrarCliente.DataPaises)); } else { registrarClienteTF.DataPaises = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryPerfil")); } filterInvoice PeopleId = new filterInvoice(); PeopleId.Id = Owner; registrarClienteTF.Perfil = await _peopleService.ConsultaAsociados(new ParamProspecto { Filter = PeopleId, Country = int.Parse(Country) }); RellenarPerfil(); registrarClienteTF.AuthRol = (await _AuthorizationService.AuthorizeAsync(User, "PolicyProfileChange")).Succeeded; return(new JsonResult(registrarClienteTF)); } return(new JsonResult(new { error = respuesta.Error })); }