diff --git a/practice/src/main/java/org/sopt/practice/service/TokenService.java b/practice/src/main/java/org/sopt/practice/service/TokenService.java index 89b0cc5..4e97c4c 100644 --- a/practice/src/main/java/org/sopt/practice/service/TokenService.java +++ b/practice/src/main/java/org/sopt/practice/service/TokenService.java @@ -10,6 +10,7 @@ import org.sopt.practice.repository.TokenRepository; import org.sopt.practice.service.dto.UserJoinResponse; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; @Service @RequiredArgsConstructor @@ -17,6 +18,7 @@ public class TokenService { private final TokenRepository tokenRepository; private final JwtTokenProvider jwtTokenProvider; + @Transactional public Token save( final Long memberId, final String refreshToken @@ -25,6 +27,8 @@ public Token save( tokenRepository.save(token); return token; } + + @Transactional public UserJoinResponse createTokens(final Long memberId){ String accessToken = jwtTokenProvider.issueAccessToken( UserAuthentication.createUserAuthentication(memberId)