From f9d6e76049aad823aaa8cb500520c7d3a7ad67e2 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 19 Jan 2021 19:37:28 +0200 Subject: Copied auth method from Update to Patch --- src/DevHive.Web/Controllers/UserController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/DevHive.Web/Controllers') diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs index 7f4e80b..471d2bb 100644 --- a/src/DevHive.Web/Controllers/UserController.cs +++ b/src/DevHive.Web/Controllers/UserController.cs @@ -105,8 +105,11 @@ namespace DevHive.Web.Controllers } [HttpPatch] - public async Task Patch(Guid id, [FromBody] JsonPatchDocument jsonPatch) + public async Task Patch(Guid id, [FromBody] JsonPatchDocument jsonPatch, [FromHeader] string authorization) { + if (!await this._userService.ValidJWT(id, authorization)) + return new UnauthorizedResult(); + UserServiceModel userServiceModel = await this._userService.PatchUser(id, jsonPatch); if (userServiceModel == null) -- cgit v1.2.3