diff --git a/src/main/java/com/ordertogether/team14_be/auth/JwtUtil.java b/src/main/java/com/ordertogether/team14_be/auth/JwtUtil.java deleted file mode 100644 index 5793f82f..00000000 --- a/src/main/java/com/ordertogether/team14_be/auth/JwtUtil.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ordertogether.team14_be.auth; - -import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.security.Keys; -import java.time.Duration; -import java.util.Date; -import javax.crypto.SecretKey; -import org.springframework.stereotype.Component; - -@Component -public class JwtUtil { - private static final SecretKey key = Keys.secretKeyFor(io.jsonwebtoken.SignatureAlgorithm.HS256); - private static final int EXPIRE_TIME = 1; - - public static String generateToken(String email) { - Date now = new Date(); - Date exp = new Date(now.getTime() + Duration.ofHours(EXPIRE_TIME).toMillis()); - - return Jwts.builder() - .setSubject(email) - .setIssuedAt(now) - .setExpiration(exp) - .signWith(key) - .compact(); - } -} diff --git a/src/main/java/com/ordertogether/team14_be/auth/application/service/AuthService.java b/src/main/java/com/ordertogether/team14_be/auth/application/service/AuthService.java index b94808cd..92b183e1 100644 --- a/src/main/java/com/ordertogether/team14_be/auth/application/service/AuthService.java +++ b/src/main/java/com/ordertogether/team14_be/auth/application/service/AuthService.java @@ -1,6 +1,5 @@ package com.ordertogether.team14_be.auth.application.service; -import com.ordertogether.team14_be.auth.JwtUtil; import com.ordertogether.team14_be.auth.application.dto.KakaoUserInfo; import com.ordertogether.team14_be.auth.presentation.KakaoClient; import com.ordertogether.team14_be.memebr.application.service.MemberService; @@ -19,8 +18,7 @@ public String kakaoLogin(String authorizationCode) { KakaoUserInfo kakaoUserInfo = kakaoClient.getUserInfo((kakaoToken)); String userKakaoEmail = kakaoUserInfo.kakaoAccount().email(); memberService.findOrCreateMember(userKakaoEmail); - String serviceToken = JwtUtil.generateToken(userKakaoEmail); - return serviceToken; + return kakaoToken; } }