Skip to content

Commit 2034ed4

Browse files
committed
feat : (#31) oauthReissueService
1 parent 23defce commit 2034ed4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package entry.dsm.gitauth.equusgithubauth.domain.auth.service
2+
3+
import entry.dsm.gitauth.equusgithubauth.domain.user.entity.repository.RefreshTokenRepository
4+
import entry.dsm.gitauth.equusgithubauth.domain.user.presentation.dto.response.TokenResponse
5+
import entry.dsm.gitauth.equusgithubauth.global.security.auth.exception.RefreshTokenNotFoundException
6+
import entry.dsm.gitauth.equusgithubauth.global.security.jwt.JwtTokenProvider
7+
import org.springframework.stereotype.Service
8+
9+
@Service
10+
class OauthReissueService(
11+
private val refreshTokenRepository: RefreshTokenRepository,
12+
private val jwtTokenProvider: JwtTokenProvider
13+
) {
14+
fun reissue(refreshToken: String): TokenResponse {
15+
val storedToken = refreshTokenRepository.findByRefreshToken(refreshToken)
16+
?: throw RefreshTokenNotFoundException()
17+
18+
return jwtTokenProvider.oauthReissueToken(storedToken)
19+
}
20+
}

0 commit comments

Comments
 (0)