From cb3b7710b9e32df408b3a38383aca049fa98214e Mon Sep 17 00:00:00 2001
From: Gunther6070 <haydenhartman10@yahoo.com>
Date: Mon, 24 Mar 2025 21:17:33 -0400
Subject: Fixed various bugs and began fixing auth system. Also started
 implementing checkout method in cupboardService

---
 .../java/com/ufund/api/ufundapi/controller/UserController.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/UserController.java')

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 dfaad3a..b0dbd1d 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
@@ -99,12 +99,13 @@ public class UserController {
      * @param key      The authentication key of the user
      * @return OK response and the user if it was successful, or
      *         INTERNAL_SERVER_ERROR if there was an issue
+     * @throws IllegalAccessException 
      */
     @PutMapping("/{username}")
-    public ResponseEntity<User> updateUser(@RequestBody User user, @PathVariable String username, @RequestHeader("jelly-api-key") String key) {
-        LOG.log(Level.INFO,"PUT: " + user + " " + username + " " + key.toString());
+    public ResponseEntity<User> updateUser(@RequestHeader("jelly-api-key") String key, @RequestBody User user, @PathVariable String username) throws IllegalAccessException {
+        LOG.log(Level.INFO,"PUT: " + user + " " + username + " " + key);
         try {
-            //authService.authenticate(username, key);
+            authService.authenticate(username, key);
             user = userService.updateUser(user, username);
             if (user != null) {
                 return new ResponseEntity<>(user, HttpStatus.OK);
-- 
cgit v1.2.3