aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-07 15:43:17 -0500
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-07 15:43:17 -0500
commit94869200a0d2f80f71fcd0efd4f82c0138b5440d (patch)
tree52eff6463b3cec7c3d6bda18e186f9272f528a2c /ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
parentfa1f1140b1e13d495c8e06e80928efb333917d31 (diff)
parentcaaf278d1fa69fef69c210edb337fa54102d2737 (diff)
downloadJellySolutions-94869200a0d2f80f71fcd0efd4f82c0138b5440d.tar.gz
JellySolutions-94869200a0d2f80f71fcd0efd4f82c0138b5440d.tar.bz2
JellySolutions-94869200a0d2f80f71fcd0efd4f82c0138b5440d.zip
Merge branch 'api-auth' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b into api-auth
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
index 7e54cfb..591d891 100644
--- a/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
+++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
@@ -1,11 +1,10 @@
package com.ufund.api.ufundapi.service;
-import java.io.IOException;
-
-import org.springframework.stereotype.Component;
-
import com.ufund.api.ufundapi.model.UserAuth;
import com.ufund.api.ufundapi.persistence.UserAuthDAO;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
@Component
public class AuthService {
@@ -24,9 +23,8 @@ public class AuthService {
* @param username The username of the user trying to be accessed.
* @param key The api key obtained by the client from logging in.
* @throws IllegalAccessException Thrown if access was denied to the user.
- * @throws IOException
- */
- public void authenticate(String username, String key) throws IllegalAccessException, IOException {
+ */
+ public void authenticate(String username, String key) throws IllegalAccessException, IOException {
var userAuth = userAuthDAO.getUserAuth(key);
if (userAuth == null || !userAuth.getUsername().equals(username)) {
throw new IllegalAccessException("Unauthorized");