diff --git a/.github/workflows/CD-dev.yml b/.github/workflows/CD-dev.yml index d088ca03..05dc2e46 100644 --- a/.github/workflows/CD-dev.yml +++ b/.github/workflows/CD-dev.yml @@ -2,7 +2,7 @@ name: CD-dev on: push: - branches: [ "feat/flight-17" ] + branches: [ "main" ] permissions: contents: read diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/auth/application/service/command/AuthInvoker.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/auth/application/service/command/AuthInvoker.kt index 69268631..afe989ac 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/auth/application/service/command/AuthInvoker.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/auth/application/service/command/AuthInvoker.kt @@ -13,22 +13,21 @@ import org.springframework.stereotype.Component class AuthInvoker ( private val authHandlerList: List, private val jwtProvider: JwtProvider, -// private val userReader: UserReader + private val userReader: UserReader ) { fun invoke(request: SocialLogin.Request, provider: SocialLoginProvider): SocialLogin.Response { val response = attemptLogin(request, provider) - return SocialLogin.Response.Success("accessToken", "refreshToken") -// return TransactionUtils.writable { -// return@writable userReader.findBySocialIdOrNull(response.socialId)?.let { -// val accessToken = jwtProvider.generateAccessToken(Claims.UserClaims(it.id)) -// val refreshToken = jwtProvider.generateRefreshToken(Claims.UserClaims(it.id)) -// SocialLogin.Response.Success(accessToken, refreshToken) -// } ?: run { -// val registrationToken = jwtProvider.generateRegistrationToken(Claims.RegistrationClaims(response.socialId, provider)) -// SocialLogin.Response.UnRegistered(registrationToken, response.nickName) -// } -// } + return TransactionUtils.writable { + return@writable userReader.findBySocialIdOrNull(response.socialId)?.let { + val accessToken = jwtProvider.generateAccessToken(Claims.UserClaims(it.id)) + val refreshToken = jwtProvider.generateRefreshToken(Claims.UserClaims(it.id)) + SocialLogin.Response.Success(accessToken, refreshToken) + } ?: run { + val registrationToken = jwtProvider.generateRegistrationToken(Claims.RegistrationClaims(response.socialId, provider)) + SocialLogin.Response.UnRegistered(registrationToken, response.nickName) + } + } } private fun attemptLogin(request: SocialLogin.Request, provider: SocialLoginProvider): AuthHandler.Response {