From 9082b19e26d081d50204c5b7502e7c80ad6ce2dd Mon Sep 17 00:00:00 2001 From: eggwhat Date: Sun, 26 May 2024 00:56:38 +0200 Subject: [PATCH] (#181) fix bug with authorization --- .../Commands/Handlers/DeleteLikeHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Application/Commands/Handlers/DeleteLikeHandler.cs b/MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Application/Commands/Handlers/DeleteLikeHandler.cs index c17a53909..6e64f0e80 100644 --- a/MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Application/Commands/Handlers/DeleteLikeHandler.cs +++ b/MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Application/Commands/Handlers/DeleteLikeHandler.cs @@ -34,7 +34,7 @@ public async Task HandleAsync(DeleteLike command, CancellationToken cancellation } var identity = _appContext.Identity; - if (!identity.IsAuthenticated) + if (identity.IsAuthenticated && identity.Id != comment.StudentId) { throw new UnauthorizedCommentAccessException(command.CommentId, identity.Id); }