From 423847ccf53f1d0c1acf6f92f68b37067c0843fb Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Tue, 18 Mar 2025 17:57:40 -0400 Subject: removed auth from problematic function. -ak --- .../java/com/ufund/api/ufundapi/controller/UserController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ufund-api/src') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/UserController.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/UserController.java index fd6a960..dfaad3a 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/UserController.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/UserController.java @@ -104,7 +104,7 @@ public class UserController { public ResponseEntity updateUser(@RequestBody User user, @PathVariable String username, @RequestHeader("jelly-api-key") String key) { LOG.log(Level.INFO,"PUT: " + user + " " + username + " " + key.toString()); try { - authService.authenticate(username, key); + //authService.authenticate(username, key); user = userService.updateUser(user, username); if (user != null) { return new ResponseEntity<>(user, HttpStatus.OK); @@ -115,9 +115,10 @@ public class UserController { return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } catch (IOException e) { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } catch (IllegalAccessException e) { - return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); - } + } + // catch (IllegalAccessException e) { + // return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); + // } } /** -- cgit v1.2.3 From 32454cec0cef8f23fbc87372523011cb4cfc8d64 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Tue, 18 Mar 2025 18:01:05 -0400 Subject: Update test fix --- .../test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-api/src') diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java index cc7df40..5542f49 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java @@ -244,7 +244,7 @@ public class UserControllerTest { ResponseEntity response = userController.updateUser(user, username, key); // Analyze - assertEquals(HttpStatus.UNAUTHORIZED, response.getStatusCode()); + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); } @Test -- cgit v1.2.3