aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java
diff options
context:
space:
mode:
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");