Skip to content

Commit 4234bd1

Browse files
committed
feat: allow anonymous access to product and user retrieval endpoints
1 parent 4e99e83 commit 4234bd1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Source/Ecommerce.Api/Controllers/ProductController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public async Task<IActionResult> GetFilteredProducts(
122122
return Ok(result.Value);
123123
}
124124

125+
[AllowAnonymous]
125126
[HttpGet("slug/{slug}")]
126127
public async Task<IActionResult> GetProductBySlug([FromRoute] string slug)
127128
{
@@ -134,6 +135,7 @@ public async Task<IActionResult> GetProductBySlug([FromRoute] string slug)
134135
return Ok(result.Value);
135136
}
136137

138+
[AllowAnonymous]
137139
[HttpGet("slug/{slug}/reviews")]
138140
public async Task<IActionResult> GetProductReviews(
139141
[FromRoute] string slug,

Source/Ecommerce.Api/Controllers/UserController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ ILogger<AuthenticationController> logger
6262
_logger = logger;
6363
}
6464

65+
[AllowAnonymous]
6566
[HttpGet("{id}")]
6667
public async Task<IActionResult> GetUserById([FromRoute] [Attributes.Guid] string id)
6768
{
@@ -75,6 +76,7 @@ public async Task<IActionResult> GetUserById([FromRoute] [Attributes.Guid] strin
7576
return Ok(res.Value);
7677
}
7778

79+
[AllowAnonymous]
7880
[HttpGet]
7981
public async Task<IActionResult> GetAllUsers()
8082
{

0 commit comments

Comments
 (0)