From 52c7f1f735e6846535dd58b08dc1ff8255a65a81 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 28 Jan 2021 21:34:08 +0200 Subject: Fixed create post and comment validation logic --- src/DevHive.Web/Controllers/PostController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/DevHive.Web') diff --git a/src/DevHive.Web/Controllers/PostController.cs b/src/DevHive.Web/Controllers/PostController.cs index 0ca041f..fe71519 100644 --- a/src/DevHive.Web/Controllers/PostController.cs +++ b/src/DevHive.Web/Controllers/PostController.cs @@ -29,7 +29,7 @@ namespace DevHive.Web.Controllers [HttpPost] public async Task Create(Guid userId, [FromBody] CreatePostWebModel createPostWebModel, [FromHeader] string authorization) { - if (await this._postService.ValidateJwtForCreating(userId, authorization)) + if (!await this._postService.ValidateJwtForCreating(userId, authorization)) return new UnauthorizedResult(); CreatePostServiceModel createPostServiceModel = @@ -47,7 +47,7 @@ namespace DevHive.Web.Controllers [Route("Comment")] public async Task AddComment(Guid userId, [FromBody] CreateCommentWebModel createCommentWebModel, [FromHeader] string authorization) { - if (await this._postService.ValidateJwtForCreating(userId, authorization)) + if (!await this._postService.ValidateJwtForCreating(userId, authorization)) return new UnauthorizedResult(); CreateCommentServiceModel createCommentServiceModel = -- cgit v1.2.3