From 4d6f593307a9e99f1e7d5657c2400efef9faff56 Mon Sep 17 00:00:00 2001 From: loinsir Date: Tue, 12 Dec 2023 16:13:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20memberId=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=A0=84,=20=ED=86=A0=ED=81=B0=EC=9D=84=20=EB=A8=BC=EC=A0=80?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Layover/Layover/Network/AuthManager.swift | 5 ++--- iOS/Layover/Layover/Scenes/Login/LoginWorker.swift | 4 ++-- iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iOS/Layover/Layover/Network/AuthManager.swift b/iOS/Layover/Layover/Network/AuthManager.swift index 419e3aa..84fc545 100644 --- a/iOS/Layover/Layover/Network/AuthManager.swift +++ b/iOS/Layover/Layover/Network/AuthManager.swift @@ -13,7 +13,7 @@ protocol AuthManagerProtocol: AnyObject { var loginType: LoginType? { get set } var memberID: Int? { get set } - func login(accessToken: String?, refreshToken: String?, memberID: Int?, loginType: LoginType?) + func login(accessToken: String?, refreshToken: String?, loginType: LoginType?) func logout() } @@ -23,10 +23,9 @@ enum LoginType: String, Codable { } extension AuthManagerProtocol { - func login(accessToken: String?, refreshToken: String?, memberID: Int?, loginType: LoginType?) { + func login(accessToken: String?, refreshToken: String?, loginType: LoginType?) { self.accessToken = accessToken self.refreshToken = refreshToken - self.memberID = memberID self.loginType = loginType isLoggedIn = true } diff --git a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift index e3a8fcc..2cdea48 100644 --- a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift +++ b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift @@ -90,8 +90,8 @@ extension LoginWorker: LoginWorkerProtocol { authManager.login(accessToken: result.data?.accessToken, refreshToken: result.data?.refreshToken, - memberID: await fetchMemberId(), loginType: .kakao) + authManager.memberID = await fetchMemberId() return true } catch { os_log(.error, log: .data, "%@", error.localizedDescription) @@ -119,8 +119,8 @@ extension LoginWorker: LoginWorkerProtocol { authManager.login(accessToken: result.data?.accessToken, refreshToken: result.data?.refreshToken, - memberID: await fetchMemberId(), loginType: .apple) + authManager.memberID = await fetchMemberId() return true } catch { os_log(.error, log: .data, "%@", error.localizedDescription) diff --git a/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift b/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift index 5f0eb90..7a0ca4b 100644 --- a/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift +++ b/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift @@ -52,8 +52,8 @@ extension SignUpWorker: SignUpWorkerProtocol { authManager.login(accessToken: data.accessToken, refreshToken: data.refreshToken, - memberID: await fetchMemberId(), loginType: .kakao) + authManager.memberID = await fetchMemberId() return true } catch { os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription) @@ -72,8 +72,8 @@ extension SignUpWorker: SignUpWorkerProtocol { } authManager.login(accessToken: data.accessToken, refreshToken: data.refreshToken, - memberID: await fetchMemberId(), loginType: .apple) + authManager.memberID = await fetchMemberId() return true } catch { os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription) From 5477193303e473b4dd24bbc1af8ff6fb93f62937 Mon Sep 17 00:00:00 2001 From: loinsir Date: Tue, 12 Dec 2023 16:55:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?:wrench:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20=ED=95=A8=EC=88=98=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Layover/Layover/Scenes/Login/LoginWorker.swift | 6 +++--- iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift index 2cdea48..e6d6ec3 100644 --- a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift +++ b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift @@ -91,7 +91,7 @@ extension LoginWorker: LoginWorkerProtocol { authManager.login(accessToken: result.data?.accessToken, refreshToken: result.data?.refreshToken, loginType: .kakao) - authManager.memberID = await fetchMemberId() + authManager.memberID = await fetchMemberID() return true } catch { os_log(.error, log: .data, "%@", error.localizedDescription) @@ -120,7 +120,7 @@ extension LoginWorker: LoginWorkerProtocol { authManager.login(accessToken: result.data?.accessToken, refreshToken: result.data?.refreshToken, loginType: .apple) - authManager.memberID = await fetchMemberId() + authManager.memberID = await fetchMemberID() return true } catch { os_log(.error, log: .data, "%@", error.localizedDescription) @@ -128,7 +128,7 @@ extension LoginWorker: LoginWorkerProtocol { } } - private func fetchMemberId() async -> Int? { + private func fetchMemberID() async -> Int? { let endPoint = userEndPointFactory.makeUserInformationEndPoint(with: nil) do { let responseData = try await provider.request(with: endPoint) diff --git a/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift b/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift index 7a0ca4b..8f2dada 100644 --- a/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift +++ b/iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift @@ -53,7 +53,7 @@ extension SignUpWorker: SignUpWorkerProtocol { authManager.login(accessToken: data.accessToken, refreshToken: data.refreshToken, loginType: .kakao) - authManager.memberID = await fetchMemberId() + authManager.memberID = await fetchMemberID() return true } catch { os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription) @@ -73,7 +73,7 @@ extension SignUpWorker: SignUpWorkerProtocol { authManager.login(accessToken: data.accessToken, refreshToken: data.refreshToken, loginType: .apple) - authManager.memberID = await fetchMemberId() + authManager.memberID = await fetchMemberID() return true } catch { os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription) @@ -81,7 +81,7 @@ extension SignUpWorker: SignUpWorkerProtocol { } } - private func fetchMemberId() async -> Int? { + private func fetchMemberID() async -> Int? { let endPoint = userEndPointFactory.makeUserInformationEndPoint(with: nil) do { let responseData = try await provider.request(with: endPoint)