From 000ebd388a2255406603914094bab16cf07a43ef Mon Sep 17 00:00:00 2001 From: echo Date: Thu, 5 Feb 2026 00:10:23 +0100 Subject: [PATCH] article detail page @public --- backend/src/modules/comment/comment.controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/modules/comment/comment.controller.ts b/backend/src/modules/comment/comment.controller.ts index 00f5bc6..252e2b7 100644 --- a/backend/src/modules/comment/comment.controller.ts +++ b/backend/src/modules/comment/comment.controller.ts @@ -91,13 +91,18 @@ export class CommentController { } @Get('reactions/user') - @UseGuards(JwtAuthGuard) + @Public() async getUserReaction( @Request() req: RequestWithUser, @Query('articleId') articleId?: string, @Query('liveBlogId') liveBlogId?: string, @Query('commentId') commentId?: string, ): Promise<{ type: string | null }> { + // If user is not authenticated, return null + if (!req.user?.id) { + return { type: null }; + } + const reaction = await this.commentService.getUserReaction( req.user.id, articleId,