Skip to content

Commit

Permalink
[MERGE] #208 -> develop
Browse files Browse the repository at this point in the history
[FEAT/#208] ํ…Œ์ŠคํŠธ ์„œ๋ฒ„ ์ฃผ์†Œ ์ถ”๊ฐ€ / ์˜จ๋ณด๋”ฉ ์„œ๋ฒ„ํ†ต์‹  ์ˆ˜์ •
  • Loading branch information
leeeyubin authored Sep 3, 2024
2 parents bec02ce + dd016d7 commit 4639b27
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
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

0 comments on commit 4639b27

Please sign in to comment.