Skip to content

Commit

Permalink
Fix : release 빌드 시 액세스 토큰 갱신 API에 대한 네트워크 로거 미부착
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Apr 7, 2024
1 parent dbc6671 commit 7cebb11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
applicationId = "com.teamwiney.winey"
minSdk = 24
targetSdk = 34
versionCode = 2
versionCode = 3
versionName = "1.0"

signingConfig = signingConfigs.getByName("debug")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private fun createOkHttpClient(
refreshToken: String,
context: Context
): OkHttpClient {
return OkHttpClient.Builder()
val builder = OkHttpClient.Builder()
.addNetworkInterceptor(
HttpLoggingInterceptor()
.apply {
Expand All @@ -90,7 +90,6 @@ private fun createOkHttpClient(
}
}
)
.addNetworkInterceptor(ChuckerInterceptor(context))
.addInterceptor { chain ->
val originalRequest = chain.request()
val modifiedRequest = originalRequest.newBuilder()
Expand All @@ -99,5 +98,10 @@ private fun createOkHttpClient(

chain.proceed(modifiedRequest)
}
.build()

if (BuildConfig.DEBUG) {
builder.addNetworkInterceptor(ChuckerInterceptor(context))
}

return builder.build()
}

0 comments on commit 7cebb11

Please sign in to comment.