Hello everyone, I implemented Jwt in .net 6 for a project. I have shared my JwtHelper and program class. When I add [Authorize()] attribute for getall request in Controller, it doesn't work, I keep getting unauthorize error. I login and accessToken is created then I use it for getall method in Postman like “Bearer xxxxxxxx” but again it returns unauthorized. I've been trying for days and couldn't find the error. Can you help me please
[HttpGet("getall")] [Authorize()] public IActionResult GetAll() { var result = _productManager.GetAll(); if (result.Success) { return Ok(result); } return BadRequest(result.Message); }
[HttpGet("getall")] [Authorize()] public IActionResult GetAll() { var result = _productManager.GetAll(); if (result.Success) { return Ok(result); } return BadRequest(result.Message); }