diff options
Diffstat (limited to 'src/DevHive.Web')
| -rw-r--r-- | src/DevHive.Web/Controllers/UserController.cs | 5 |
1 files changed, 4 insertions, 1 deletions
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<IActionResult> Patch(Guid id, [FromBody] JsonPatchDocument<User> jsonPatch) + public async Task<IActionResult> Patch(Guid id, [FromBody] JsonPatchDocument<User> 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) |
