-
Notifications
You must be signed in to change notification settings - Fork 2
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 header 에 token 적용 #42
Conversation
override fun onCreate() { | ||
super.onCreate() | ||
PrefsManager.init(applicationContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datastore도 이런식으로 사용될 수 있는지에 대해 고민을 좀 해보아야하겠군요
@@ -102,6 +103,7 @@ class LoginFragment : Fragment() { | |||
viewModel.response.collect { response -> | |||
Timber.d("accesstoken:${response?.accessToken}, refreshtoken:${response?.refreshToken}") | |||
response?.run { | |||
PrefsManager.setTokens(response.accessToken, response.refreshToken) | |||
DataStoreRepository( | |||
DataStoreManager(requireContext())).saveAccessToken( | |||
response.accessToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래의 datastore코드는 일부러 남겨놓으신걸까요?
proceed( | ||
request().newBuilder() | ||
.addHeader("AUTHORIZATION", PrefsManager.accessToken) | ||
.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터셉터 사용은 처음보는데 여러방면에서 사용하기 좋은놈이군요
수고하셨습니다! |
SharedPreference 에 token 값 저장하여
interceptor 이용하여 token 값 넣어주었습니다.