Conversation
- ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding 채택해주는 로직 LoginViewController로 이동 (기존 AuthRepository)
- LoginViewModel에서 apple 로그인 결과에 따라 값을 방출할 수 있도록 구현 - LoginUseCaseProtocol, LoginUseCase appleLogin 함수 정의 및 구현
- AuthRepositoryProtocol, AuthRepository appleLogin 정의 및 구현 - 받은 닉네임, 토큰 값을 통해 서버 통신 로직 구현 - UserDefaults에 닉네임 저장 및 불러오는 로직 구현
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
generalban
left a comment
There was a problem hiding this comment.
오탈자 체크만 해주시면 됩니닷~ 고생하셨어요
| static let loginBottomPadding: CGFloat = 54 | ||
| private enum Layout { | ||
| static let horizontalMargin: CGFloat = 20 | ||
| static let loginButtonHegiht: CGFloat = 54 |
There was a problem hiding this comment.
사소한 타이포~ Hegiht → Height 오타 수정해주세요
There was a problem hiding this comment.
Apple 로그인 구현 수고 많으셨습니다! 사소한 오타(loginButtonHegiht)만 수정해주시면 바로 Approve 드리겠습니다 :)
| try self.saveNickname(nickname: nickname) | ||
| savedNickname = nickname | ||
| } else { | ||
| savedNickname = try self.loadNickname() |
There was a problem hiding this comment.
그냥 의견일뿐입니다! 수정할거 없습니다! if let + else에서 nickname 값을 한 번 더 리턴하지 않도록 guard let을 써서 early exit 방식도 가능합니닷
There was a problem hiding this comment.
넵 ~ 최초 로그인 시에만 닉네임을 저장하고 불러온 닉네임이라면 저장할 필요가 없으니까 if - else를 사용하긴 했습니다.
🌁 Background
소셜 로그인 중 애플 로그인 기능을 구현하였습니다.
AuthenticationServices 프레임워크를 추가하여 Apple 로그인을 진행하였습니다.
📱 Screenshot
Simulator.Screen.Recording.-.iPhone.15.-.2025-07-02.at.14.39.11.mp4
👩💻 Contents
✅ Testing
이전 카카오 로그인 PR에서 구현한 LoginViewController에 애플 로그인 버튼을 추가하여 테스트를 진행하였습니다.
카카오 로그인과 마찬가지로 Keychain에 서버로부터 받은 토큰 값을 저장한 것까지 테스트 완료하였습니다.
📝 Review Note
Apple 로그인 닉네임
LoginViewController에서 Apple authToken 및 닉네임 가져오기
ASAuthorizationControllerDelegate,ASAuthorizationControllerPresentationContextProviding를 채택해서 내부 메서드를 구현해주어야 authToken과 원하는 유저 정보를 가져올 수 있습니다.ASAuthorizationControllerDelegate은 인증 흐름이 완료되었을 때 성공 및 실패를 받아 처리하는 역할을 하고,ASAuthorizationControllerPresentationContextProviding은 인증 UI를 어디서 표시할지 알려주는 역할을 합니다.ASAuthorizationControllerPresentationContextProviding은 UIWindow를 필요로 하고, Repository 단에서 view.window를 접근하기에는 어려움이 있었습니다.📣 Related Issue