diff options
| author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-06 21:49:56 -0500 | 
|---|---|---|
| committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-06 21:49:56 -0500 | 
| commit | 7cb123c21bef247a2216545bc18245136f2ddf78 (patch) | |
| tree | 344df7a075df5b8c1138c6d841b4bf0b738bc755 | |
| parent | 953db99263178bcf122a415b50765fa283a8f42e (diff) | |
| download | JellySolutions-7cb123c21bef247a2216545bc18245136f2ddf78.tar.gz JellySolutions-7cb123c21bef247a2216545bc18245136f2ddf78.tar.bz2 JellySolutions-7cb123c21bef247a2216545bc18245136f2ddf78.zip | |
Added IOException throw to authenticate
| -rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/service/AuthService.java | 12 | 
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"); | 
