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

[mod] 자동 로그인, 로그인 로직 수정 #171

Merged
merged 8 commits into from
Sep 20, 2023
Merged

Conversation

Dan2dani
Copy link
Member

@Dan2dani Dan2dani commented Sep 20, 2023

Related issue 🛠

Work Description ✏️

  • 자체 로그인 UiState로 수정
  • 자체 로그인 refresh token 저장
  • 소셜 로그인 자동 로그인 기능 구현(회원가입은 닉네임 설정 성공했을 때, 로그인은 소셜 로그인 성공했을 때)
  • 로그인 전에는 authorization header에 안담기도록 수정
  • 자동 로그인 스플래시 뷰로 이동

To Reviewers 📢

}

fun login() {
viewModelScope.launch {
authRepository.login(RequestLogin(loginEmail.value, loginPassword.value))
.onSuccess { loginResponse ->
val responseHeader = loginResponse.headers()
val accessToken = responseHeader[AUTHORIZATION].toString()
val accessToken = responseHeader[AUTHORIZATION]
val refreshToken = responseHeader[AUTHORIZATION_REFRESH]
Copy link
Member

Choose a reason for hiding this comment

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

refresh 도 해야하는지 생각을 못했다 .. 🐰 ❤️

@@ -19,26 +20,33 @@ class LogInViewModel @Inject constructor(
) : ViewModel() {
val loginEmail = MutableStateFlow("")
val loginPassword = MutableStateFlow("")
private val _loginState = MutableStateFlow<Boolean?>(null)
private val _loginState = MutableStateFlow<UiState<Boolean>>(UiState.Loading)
Copy link
Member

Choose a reason for hiding this comment

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

중복확인도 uistate 로 변경할까염

Copy link
Member Author

Choose a reason for hiding this comment

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

조하염~~

@@ -64,20 +64,16 @@ class LoginActivity :
}

private fun moveToHome() {
Copy link
Member

Choose a reason for hiding this comment

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

짱이다

Copy link
Collaborator

@jihyunniiii jihyunniiii left a comment

Choose a reason for hiding this comment

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

형님 역시 짱이십니다

@Dan2dani Dan2dani merged commit 28552dc into develop Sep 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[mod] 자체 로그인, 자동 로그인 수정
3 participants