File tree 1 file changed +20
-0
lines changed
src/main/kotlin/entry/dsm/gitauth/equusgithubauth/domain/auth/service
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments