public async Task <JsonResult> OnPostAsignarLimite([FromBody] AllocateQuota limiteCliente) { 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(); IdUser = User.Claims.Where(x => x.Type == ClaimTypes.NameIdentifier).Select(x => x.Value).SingleOrDefault(); var token = HttpContext.Session.GetString("token"); limiteCliente.Country = int.Parse(Country); limiteCliente.Confirmant = Confirmant; limiteCliente.User = IdUser; var respuesta = await _peopleService.MutacionLimiteCuentaAsync(limiteCliente, token); if (respuesta != "You are not authorised to perform this action") { 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); } } return(new JsonResult(respuesta)); }
public async Task <string> MutacionLimiteCuentaAsync(AllocateQuota limiteCredito, string token) { try { return(await _consumer.MutacionLimiteCuentaAsync(limiteCredito, token)); } catch { return(null); } }