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..e6d6ec3 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) @@ -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 5f0eb90..8f2dada 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) @@ -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)