Skip to content

Commit

Permalink
[hotfix]: refresh token error 수정, 탈퇴 유저 정보 clear 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
oh-bom committed Nov 5, 2024
1 parent 650e40f commit 080e331
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ object TokenManager {
fun clearData(context:Context){
val editor=context.getSharedPreferences(USER_INFO,Context.MODE_PRIVATE).edit()
editor.clear()
editor.apply()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class LoginViewModel @Inject constructor(
}
if(!data?.result?.refreshToken.isNullOrEmpty()){
data?.result?.refreshToken.let{
TokenManager.saveRefreshToken(context, it!!)
tokenManager.saveRefreshToken(context, it!!)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class ManageAccountViewModel @Inject constructor(
if(signupType== SIGNUP_SOCIAL_KAKAO) withdrawKakao()

localDataSource.resetSignupType()
localDataSource.clearAllPreferences()

}.onFailure { exception: Throwable ->
_withdrawState.value=UiState.Error(exception.message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ class LocalDataSource @Inject constructor(
return prefs.getBoolean(key,false)
}

// 탈퇴시
fun clearAllPreferences() {
val prefs = getPreferences(APP_PREF)
prefs.edit().clear().apply() // 모든 데이터 삭제

val userPrefs = getPreferences(USER_INFO)
userPrefs.edit().clear().apply()

val signupPrefs = getPreferences(SIGNUP_TYPE)
signupPrefs.edit().clear().apply()
}


companion object {
const val USER_INFO="USER_INFO"
const val INFO_NULL="INFO_NULL"
Expand Down

0 comments on commit 080e331

Please sign in to comment.