Skip to content

Commit 187c9b0

Browse files
committed
Feat: LoginView UI 구현 (#T3-86)
- LoginView UI 구현 - SocialLoginButton Component 구현 (카카오, 애플)
1 parent f884132 commit 187c9b0

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

Projects/Presentation/Sources/Common/Components/SocialLoginButton.swift renamed to Projects/Presentation/Sources/Login/View/Components/SocialLoginButton.swift

File renamed without changes.

Projects/Presentation/Sources/Login/LoginView.swift renamed to Projects/Presentation/Sources/Login/View/LoginView.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class LoginView: BaseViewController<LoginViewModel> {
4747
}
4848

4949
kakaoLoginButton.addAction(UIAction { [weak self] _ in
50-
self?.viewModel.action(input: .fetchKakaoToken)
50+
self?.viewModel.action(input: .kakaoLogin)
5151
}, for: .touchUpInside)
5252

5353
appleLoginButton.addAction(UIAction { [weak self] _ in
@@ -86,16 +86,17 @@ public final class LoginView: BaseViewController<LoginViewModel> {
8686
}
8787

8888
override func bind() {
89-
viewModel.output.fetchTokenPublisher
89+
viewModel.output.loginResultPublisher
9090
.receive(on: DispatchQueue.main)
91-
.sink { [weak self] fetchTokenResult in
91+
.sink { [weak self] loginResult in
9292
guard let self else { return }
93-
if fetchTokenResult {
94-
BitnagilLogger.log(logType: .debug, message: "토큰 값 가져오기 성공")
93+
if loginResult {
94+
BitnagilLogger.log(logType: .debug, message: "서버 로그인 성공")
9595
let agreementView = TermsAgreementView(viewModel: self.viewModel)
9696
self.navigationController?.pushViewController(agreementView, animated: true)
9797
} else {
98-
BitnagilLogger.log(logType: .error, message: "토큰 값 가져오기 실패")
98+
// TODO: 로그인 실패 시, 에러 처리
99+
BitnagilLogger.log(logType: .error, message: "서버 로그인 실패")
99100
}
100101
}
101102
.store(in: &cancellables)
@@ -135,7 +136,7 @@ extension LoginView: ASAuthorizationControllerDelegate {
135136
if let givenName, let familyName {
136137
nickname = "\(familyName)\(givenName)"
137138
}
138-
self.viewModel.action(input: .fetchAppleToken(nickname: nickname, authToken: authToken))
139+
self.viewModel.action(input: .appleLogin(nickname: nickname, authToken: authToken))
139140
}
140141

141142
public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: any Error) {

0 commit comments

Comments
 (0)