diff --git a/src/Services/Identity/Identity.API/Services/ProfileService.cs b/src/Services/Identity/Identity.API/Services/ProfileService.cs index b7637fef2..bc1efcea1 100644 --- a/src/Services/Identity/Identity.API/Services/ProfileService.cs +++ b/src/Services/Identity/Identity.API/Services/ProfileService.cs @@ -106,6 +106,11 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Services if (!string.IsNullOrWhiteSpace(user.ZipCode)) claims.Add(new Claim("address_zip_code", user.ZipCode)); + if (user.TenantId != 0) + { + claims.Add(new Claim("tenant_id", user.TenantId.ToString())); + } + if (_userManager.SupportsUserEmail) { claims.AddRange(new[] diff --git a/src/Web/WebMVC/Controllers/OrderController.cs b/src/Web/WebMVC/Controllers/OrderController.cs index 40e48b39d..501276513 100644 --- a/src/Web/WebMVC/Controllers/OrderController.cs +++ b/src/Web/WebMVC/Controllers/OrderController.cs @@ -95,7 +95,6 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { var user = _appUserParser.Parse(HttpContext.User); - var vm = await _orderSvc.GetMyOrders(user); if (user.TenantId == 1) diff --git a/src/Web/WebMVC/Services/IdentityParser.cs b/src/Web/WebMVC/Services/IdentityParser.cs index 70e82e53b..a00578d3c 100644 --- a/src/Web/WebMVC/Services/IdentityParser.cs +++ b/src/Web/WebMVC/Services/IdentityParser.cs @@ -33,7 +33,8 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services SecurityNumber = claims.Claims.FirstOrDefault(x => x.Type == "card_security_number")?.Value ?? "", State = claims.Claims.FirstOrDefault(x => x.Type == "address_state")?.Value ?? "", Street = claims.Claims.FirstOrDefault(x => x.Type == "address_street")?.Value ?? "", - ZipCode = claims.Claims.FirstOrDefault(x => x.Type == "address_zip_code")?.Value ?? "" + ZipCode = claims.Claims.FirstOrDefault(x => x.Type == "address_zip_code")?.Value ?? "", + TenantId = int.Parse(claims.Claims.FirstOrDefault(x => x.Type == "tenant_id")?.Value ?? "0") }; } throw new ArgumentException(message: "The principal must be a ClaimsPrincipal", paramName: nameof(principal));