-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a2ccae
commit 90cc5b2
Showing
8 changed files
with
95 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
domain/src/main/kotlin/co/orange/domain/usecase/AuthReissueTokenUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package co.orange.domain.usecase | ||
|
||
import co.orange.domain.entity.request.ReissueRequestModel | ||
import co.orange.domain.repository.AuthRepository | ||
import co.orange.domain.repository.UserRepository | ||
import javax.inject.Inject | ||
|
||
class AuthReissueTokenUseCase @Inject constructor( | ||
private val authRepository: AuthRepository, | ||
private val userRepository: UserRepository, | ||
) { | ||
suspend operator fun invoke() = runCatching { | ||
val response = authRepository.postReissueTokens( | ||
ReissueRequestModel(userRepository.getRefreshToken()), | ||
) | ||
userRepository.setTokens( | ||
response.accessToken, | ||
response.refreshToken, | ||
) | ||
return@runCatching response | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters