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/#72] 소셜 로그인 / 서버통신 구현 #87

Merged
merged 16 commits into from
Jul 16, 2024

Conversation

leeeyubin
Copy link
Member

⛳️ Work Description

  • 카카오 accessToken 받아서 서버랑 통신
  • 터닝 계정으로 카카오 연결
  • 서버에서 받은 accessToken, refreshToken 저장

📢 To Reviewers

  • 이거 머지하고 나면 디코에 올려둔 걸로 로컬 프로퍼티 수정해주세요!!!

@leeeyubin leeeyubin added FEAT ✨ 새로운 기능 구현 유빈💙 유빈 labels Jul 15, 2024
@leeeyubin leeeyubin self-assigned this Jul 15, 2024
@leeeyubin leeeyubin changed the title [FEAT/#72] on boarding [FEAT/#72] 온보딩 뷰 / 서버통신 로직 구현 Jul 15, 2024
@leeeyubin leeeyubin changed the title [FEAT/#72] 온보딩 뷰 / 서버통신 로직 구현 [FEAT/#72] 소셜 로그인 / 서버통신 로직 구현 Jul 15, 2024
Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

유빈이는 정말 최고야,,, 짱이야,,, 이걸 해내다니,,, 세상에 이런 갓기가,,, 진짜 개큰박수👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻

import javax.inject.Inject

class TerningDataStoreImpl @Inject constructor(
private val dataStore: SharedPreferences,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SharedPreferences 사용하는게 자동 로그인을 위한거 맞나요?!?!???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네! 맞습니당

Comment on lines 96 to 97
if (response.accessToken == null) _signInSideEffects.emit(SignInSideEffect.NavigateSignUp)
else _signInSideEffects.emit(SignInSideEffect.NavigateToHome)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호!! navigate도 sideEffect로 처리하는군요!!!! 새로운거 배워갑니다❤️

Comment on lines +5 to +6
<string name="server_success">서버통신에 성공했어요</string>
<string name="server_failure">서버통신에 실패했어요</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

센스쟁이❤️

accessToken,
SignInRequestModel(platform)
).onSuccess { response ->
tokenRepository.setTokens(response.accessToken, response.refreshToken)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessToken이 null인 상황도 있는 것 같은데 tokenRepository에 null값이 들어가도 괜찮은가요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

날카롭다,,, 그 경우를 고려 못했네요!!!! 바로 로직 수정했습니당~~!! 최고!!

Copy link
Contributor

@arinming arinming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

유비니가 최고야

Comment on lines +68 to 71
@JWT
fun provideJWTRetrofit(
client: OkHttpClient,
factory: Converter.Factory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPEN -> JWT로 바꾼 이유가 있나용!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPEN은 오픈API를 사용했기 때문에 네이밍을 그렇게 지었습니다!
이제부터는 실제 사용할 base.url을 넣어줬기 때문에 네이밍을 수정해야 할 것 같아서 바꿔줬어요!!

Copy link
Member

@boiledeggg boiledeggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

터닝 안드 교과서 그 자체네요~!!
코드 잘 숙지해서 제 코드에 잘 반영해야겠습니닷

private fun signInSuccess(
accessToken: String,
platform: String = KAKAO
) {
viewModelScope.launch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 여러 번 viewModelScope를 사용하신 이유가 있나요??
정지 함수를 사용할 수도 있을 것 같은데 뭔 차이가 있는지 궁금해요,,,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적용할 수 있는 건 suspend fun 적용했습니당~!!

@leeeyubin leeeyubin merged commit 888b996 into develop Jul 16, 2024
1 check passed
@leeeyubin leeeyubin changed the title [FEAT/#72] 소셜 로그인 / 서버통신 로직 구현 [FEAT/#72] 소셜 로그인 / 서버통신 구현 Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 유빈💙 유빈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 소셜 로그인 / 서버통신 구현
4 participants