Skip to content

Commit

Permalink
fix: add redirect log
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Jul 29, 2024
1 parent 587d8fd commit 9a27f6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import com.hero.alignlab.client.kakao.config.KakaoOAuthClientConfig
import com.hero.alignlab.client.kakao.model.response.GenerateKakaoOAuthTokenResponse
import com.hero.alignlab.domain.auth.model.OAuthProvider
import com.hero.alignlab.domain.auth.model.request.OAuthAuthorizedRequest
import com.hero.alignlab.domain.dev.model.request.DevRedirectedRequest
import com.hero.alignlab.domain.dev.model.response.DevOAuthCodeResponse
import com.hero.alignlab.domain.dev.model.response.DevRedirectedResponse
import io.github.oshai.kotlinlogging.KotlinLogging
import org.springframework.stereotype.Service

Expand All @@ -24,6 +26,18 @@ class DevOAuthService(
return DevOAuthCodeResponse(provider)
}

fun redirectTest(
provider: OAuthProvider,
request: DevRedirectedRequest
): DevRedirectedResponse {
logger.info { "redirect test provider: $provider request: $request" }

return DevRedirectedResponse(
provider = provider,
requestParams = request,
)
}

suspend fun resolveOAuth(
provider: OAuthProvider,
request: OAuthAuthorizedRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.hero.alignlab.domain.auth.model.OAuthProvider
import com.hero.alignlab.domain.auth.model.request.OAuthAuthorizedRequest
import com.hero.alignlab.domain.dev.application.DevOAuthService
import com.hero.alignlab.domain.dev.model.request.DevRedirectedRequest
import com.hero.alignlab.domain.dev.model.response.DevRedirectedResponse
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springdoc.core.annotations.ParameterObject
Expand All @@ -29,10 +28,7 @@ class DevOAuthResource(
suspend fun redirectedDevOAuthAuthorizeCode(
@PathVariable provider: OAuthProvider,
@ParameterObject request: DevRedirectedRequest,
) = DevRedirectedResponse(
provider = provider,
requestParams = request,
).wrapOk()
) = devOAuthService.redirectTest(provider, request).wrapOk()

@Operation(summary = "OAuth Token Generate")
@PostMapping("/api/dev/v1/oauth/{provider}/token")
Expand Down

0 comments on commit 9a27f6e

Please sign in to comment.