Skip to content

Commit 977e6ce

Browse files
author
ericuss
committed
fix tests of basket
1 parent a29a34f commit 977e6ce

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/Services/Basket/Basket.API/Controllers/BasketController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public async Task<ActionResult> CheckoutAsync([FromBody]BasketCheckout basketChe
7070
return BadRequest();
7171
}
7272

73-
var userName = User.FindFirst(x => x.Type == ClaimTypes.Name).Value;
73+
var userName = this.HttpContext.User.FindFirst(x => x.Type == ClaimTypes.Name).Value;
7474

7575
var eventMessage = new UserCheckoutAcceptedIntegrationEvent(userId, userName, basketCheckout.City, basketCheckout.Street,
7676
basketCheckout.State, basketCheckout.Country, basketCheckout.ZipCode, basketCheckout.CardNumber, basketCheckout.CardHolderName,

src/Services/Basket/Basket.FunctionalTests/Base/AutoAuthorizeMiddleware.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public async Task Invoke(HttpContext httpContext)
2121

2222
identity.AddClaim(new Claim("sub", IDENTITY_ID));
2323
identity.AddClaim(new Claim("unique_name", IDENTITY_ID));
24+
identity.AddClaim(new Claim(ClaimTypes.Name, IDENTITY_ID));
2425

2526
httpContext.User.AddIdentity(identity);
2627

0 commit comments

Comments
 (0)