diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt index a95158f4..af53bf70 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt @@ -22,7 +22,8 @@ class CheckAuthCodeUseCase( ) { fun execute(email: String, code: String) { - val authCode = queryAuthCodePort.queryAuthCodeByEmail(email) ?: throw AuthExceptions.RequiredNewEmailAuthentication() + val authCode = queryAuthCodePort.queryAuthCodeByEmail(email) + ?: throw AuthExceptions.RequiredNewEmailAuthentication() if (!authCode.code.match(code)) { throw AuthExceptions.DifferentAuthCode() diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCase.kt index c66f9c65..096af534 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCase.kt @@ -13,7 +13,7 @@ import team.comit.simtong.global.annotation.UseCase * @author Chokyunghyeon * @author kimbeomjin * @date 2022/09/18 - * @version 1.0.0 + * @version 1.2.5 **/ @UseCase class ReissueTokenUseCase( @@ -21,13 +21,13 @@ class ReissueTokenUseCase( private val queryRefreshTokenPort: QueryRefreshTokenPort ) { - fun execute(request: String): TokenResponse { - val token = queryRefreshTokenPort.queryRefreshTokenByToken(request) + fun execute(token: String): TokenResponse { + val refreshToken = queryRefreshTokenPort.queryRefreshTokenByToken(token) ?: throw AuthExceptions.RefreshTokenNotFound() return jwtPort.receiveToken( - userId = token.userId, - authority = token.authority + userId = refreshToken.userId, + authority = refreshToken.authority ) } } \ No newline at end of file diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt index 3a67c70b..8820da58 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt @@ -28,9 +28,13 @@ class SendAuthCodeUseCase( val authCodeLimit = queryAuthCodeLimitPort.queryAuthCodeLimitByEmail(email) ?: AuthCodeLimit.issue(email) - commandAuthCodeLimitPort.save(authCodeLimit.increaseCount()) + commandAuthCodeLimitPort.save( + authCodeLimit.increaseCount() + ) - val authCode = commandAuthCodePort.save(AuthCode.issue(email)) + val authCode = commandAuthCodePort.save( + AuthCode.issue(email) + ) sendEmailPort.sendAuthCode(authCode.code.value, email) }