Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT/#208] 테스트 서버 주소 추가 / 온보딩 서버통신 수정 #209

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
buildConfigField(
"String",
"BASE_URL",
gradleLocalProperties(rootDir, providers).getProperty("base.url")
gradleLocalProperties(rootDir, providers).getProperty("test.base.url")
)
}
release {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/terning/point/di/AuthInterceptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class AuthInterceptor @Inject constructor(
override fun intercept(chain: Interceptor.Chain): Response {
val originalRequest = chain.request()

Timber.d("GET REFRESH TOKEN : ${terningDataStore.refreshToken}")
Timber.d("GET ACCESS TOKEN : ${terningDataStore.accessToken}")

val authRequest = if (terningDataStore.refreshToken.isNotBlank()) {
val authRequest = if (terningDataStore.accessToken.isNotBlank()) {
originalRequest.newBuilder().newAuthBuilder().build()
} else {
originalRequest
Expand All @@ -45,7 +45,7 @@ class AuthInterceptor @Inject constructor(
)
}.onSuccess { data ->
terningDataStore.apply {
refreshToken = data.refreshToken
accessToken = data.accessToken
}

response.close()
Expand Down Expand Up @@ -77,7 +77,7 @@ class AuthInterceptor @Inject constructor(
}

private fun Request.Builder.newAuthBuilder() =
this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.refreshToken}")
this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.accessToken}")

companion object {
private const val CODE_TOKEN_EXPIRED = 401
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import kotlinx.serialization.Serializable

@Serializable
data class TokenReissueResponseDto(
@SerialName("refreshToken")
val refreshToken: String
@SerialName("accessToken")
val accessToken: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import com.terning.data.dto.response.TokenReissueResponseDto
import com.terning.domain.entity.auth.TokenReissue

fun TokenReissueResponseDto.toTokenReissue(): TokenReissue =
TokenReissue(refreshToken = refreshToken)
TokenReissue(accessToken = accessToken)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.terning.domain.entity.auth

data class TokenReissue (
val refreshToken : String
val accessToken : String
)
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fun SignUpScreen(
showBottomSheet = false
onFetchCharacter(index)
},
initialSelectedOption = signUpState.character
initialSelectedOption = signUpState.profileImage
)
}
Text(
Expand All @@ -126,7 +126,7 @@ fun SignUpScreen(
modifier = modifier.noRippleClickable {
showBottomSheet = true
},
index = signUpState.character
index = signUpState.profileImage
)
}
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.terning.feature.R

data class SignUpState(
val name: String = "",
val character: Int = 0,
val profileImage: Int = 0,
val drawLineColor: Color = Grey500,
@StringRes val helper: Int = R.string.sign_up_helper,
val helperIcon: Int? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class SignUpViewModel @Inject constructor(
}
}

fun fetchCharacter(character: Int) {
_state.value = _state.value.copy(character = character)
fun fetchCharacter(profileImage: Int) {
_state.value = _state.value.copy(profileImage = profileImage)
}

fun fetchAuthId(authId: String) {
Expand All @@ -95,7 +95,7 @@ class SignUpViewModel @Inject constructor(
state.value.run {
SignUpRequest(
name = name,
profileImage = character,
profileImage = profileImage,
authType = KAKA0
)
}
Expand Down
Loading