aboutsummaryrefslogtreecommitdiff
path: root/ufund-api
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-api')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java12
1 files changed, 7 insertions, 5 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 ac86ff1..7e54cfb 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,10 +1,11 @@
package com.ufund.api.ufundapi.service;
-import com.ufund.api.ufundapi.model.UserAuth;
-import com.ufund.api.ufundapi.persistence.UserAuthDAO;
+import java.io.IOException;
+
import org.springframework.stereotype.Component;
-import java.io.IOException;
+import com.ufund.api.ufundapi.model.UserAuth;
+import com.ufund.api.ufundapi.persistence.UserAuthDAO;
@Component
public class AuthService {
@@ -23,8 +24,9 @@ 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.
- */
- public void authenticate(String username, String key) throws IllegalAccessException {
+ * @throws 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");