[backend/api] Extract authorize & authenticate attributes to TimelineController

This commit is contained in:
Laura Hausmann 2024-07-13 00:20:47 +02:00
parent 68867aee90
commit e4b0f32097
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -16,6 +16,8 @@ using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Controllers.Web; namespace Iceshrimp.Backend.Controllers.Web;
[ApiController] [ApiController]
[Authenticate]
[Authorize]
[LinkPagination(20, 80)] [LinkPagination(20, 80)]
[EnableRateLimiting("sliding")] [EnableRateLimiting("sliding")]
[Route("/api/iceshrimp/timelines")] [Route("/api/iceshrimp/timelines")]
@ -23,8 +25,6 @@ namespace Iceshrimp.Backend.Controllers.Web;
public class TimelineController(DatabaseContext db, NoteRenderer noteRenderer, CacheService cache) : ControllerBase public class TimelineController(DatabaseContext db, NoteRenderer noteRenderer, CacheService cache) : ControllerBase
{ {
[HttpGet("home")] [HttpGet("home")]
[Authenticate]
[Authorize]
[ProducesResults(HttpStatusCode.OK)] [ProducesResults(HttpStatusCode.OK)]
public async Task<IEnumerable<NoteResponse>> GetHomeTimeline(PaginationQuery pq) public async Task<IEnumerable<NoteResponse>> GetHomeTimeline(PaginationQuery pq)
{ {