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

Network [#84] 회원 탈퇴 & 로그아웃 API 구현 #85

Merged
merged 6 commits into from
Jan 15, 2024

Conversation

kim-seonwoo
Copy link
Member

@kim-seonwoo kim-seonwoo commented Jan 15, 2024

👾 작업 내용

  • 회원가입 부분의 API를 수정하였습니다.
  • 회원 가입 헤더의 형식을 따로 추가하였습니다.
  • 회원 가입 데이터 중 앱 목록 부분은 하드 코딩 하였습니다.
    static let signUpHeader = [contentType: applicationJSON,
                                       auth : appleAccessToken,
                                        OS: iOS,]
  • Alert 부분의 타입에 따라 로그아웃, 회원 탈퇴 부분을 구현하였습니다.
extension AlertViewController: AlertDelegate {
    func enabledButtonTapped() {
        let provider = Providers.AuthProvider
        if alertType == .HMHQuitALert {
            provider.request(target: .revoke, instance: BaseResponse<RevokeResponseDTO>.self, viewController: self) { data in
                print("revoke!!!!!!")
                UserManager.shared.clearData()
            }
        } else {
            let provider = Providers.AuthProvider
            
            provider.request(target: .logout, instance: BaseResponse<LogoutResponseDTO>.self, viewController: self) { data in
                print("logout!!!!!!")
                UserManager.shared.clearAll()
            }
        }
  • UseraManager에 대해 값을 삭제하는 부분을 추가하였습니다.
  • 스플래시 부분에 토큰 재발급 로직을 옮겼습니다.
    private func setSplashView() {
        view.backgroundColor = .background
        let provider = Providers.AuthProvider
        provider.request(target: .tokenRefresh, instance: BaseResponse<RefreshTokebResponseDTO>.self, viewController: LoginViewController()) { data in
            if let data = data.data {
                UserManager.shared.updateToken(data.token.accessToken, data.token.accessToken)
                print("token",data.token.accessToken,data.token.accessToken)
            }
        }
    }

🚀 PR Point

  • 인터셉터 관련 수정토록 하겠습니다!

📸 스크린샷

구현 내용 스크린샷
화면종류 image

✅ Issue

Resolved #84

@kim-seonwoo kim-seonwoo added 😎선우 선우의 issue 📡 network api 작업 labels Jan 15, 2024
@kim-seonwoo kim-seonwoo added this to the 🚀1차 스프린트🚀 milestone Jan 15, 2024
@kim-seonwoo kim-seonwoo self-assigned this Jan 15, 2024
@kim-seonwoo kim-seonwoo linked an issue Jan 15, 2024 that may be closed by this pull request
Copy link
Member

@Zoe0929 Zoe0929 left a comment

Choose a reason for hiding this comment

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

✨✨빠르다 최고다✨✨

Copy link
Contributor

@boyeon0119 boyeon0119 left a comment

Choose a reason for hiding this comment

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

LGTM 🌞

Comment on lines +89 to +96
print("revoke!!!!!!")
UserManager.shared.clearData()
}
} else {
let provider = Providers.AuthProvider

provider.request(target: .logout, instance: BaseResponse<LogoutResponseDTO>.self, viewController: self) { data in
print("logout!!!!!!")
Copy link
Contributor

Choose a reason for hiding this comment

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

p5. 조금 더 신나게 아이콘을 이용해 프린트 찍는건 어떠신지?
Mino cute _ new journey to the west NJTTW _ #WINNER Song Mino

Copy link
Member Author

Choose a reason for hiding this comment

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

아이콘은 지양하겠습니다

@kim-seonwoo kim-seonwoo merged commit c21fa76 into develop Jan 15, 2024
@Zoe0929 Zoe0929 deleted the network/#84-Approve branch January 19, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📡 network api 작업 😎선우 선우의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Network] 권한 설정 반영 회원 가입 구현
3 participants