Skip to content

Commit

Permalink
🔧 코드 리뷰 반영 네이밍 컨벤션 등 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
loinsir committed Dec 11, 2023
1 parent 973dd56 commit a7be9c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions iOS/Layover/Layover/Network/AuthManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protocol AuthManagerProtocol: AnyObject {
var refreshToken: String? { get set }
var isLoggedIn: Bool? { get set }
var loginType: LoginType? { get set }
var memberId: Int? { get set }
var memberID: Int? { get set }

func logout()
}
Expand All @@ -25,7 +25,7 @@ extension AuthManagerProtocol {
func logout() {
accessToken = nil
refreshToken = nil
memberId = nil
memberID = nil
loginType = nil
isLoggedIn = false
}
Expand All @@ -39,7 +39,7 @@ final class AuthManager: AuthManagerProtocol {
@KeychainStored(key: "refreshToken") var refreshToken: String?

@UserDefaultStored(key: UserDefaultKey.isLoggedIn, defaultValue: false) var isLoggedIn: Bool?
@UserDefaultStored(key: UserDefaultKey.memberId, defaultValue: nil) var memberId: Int?
@UserDefaultStored(key: UserDefaultKey.memberId, defaultValue: nil) var memberID: Int?
@UserDefaultStored(key: UserDefaultKey.loginType, defaultValue: nil) var loginType: LoginType?

static let shared = AuthManager()
Expand Down
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Scenes/Login/LoginWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ extension LoginWorker: LoginWorkerProtocol {
authManager.refreshToken = result.data?.refreshToken
authManager.isLoggedIn = true
authManager.loginType = .kakao
authManager.memberId = await fetchMemberId()
authManager.memberID = await fetchMemberId()
return true
} catch {
os_log(.error, log: .data, "%@", error.localizedDescription)
Expand Down Expand Up @@ -122,7 +122,7 @@ extension LoginWorker: LoginWorkerProtocol {
authManager.refreshToken = result.data?.refreshToken
authManager.isLoggedIn = true
authManager.loginType = .apple
authManager.memberId = await fetchMemberId()
authManager.memberID = await fetchMemberId()
return true
} catch {
os_log(.error, log: .data, "%@", error.localizedDescription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class SettingViewController: BaseViewController {
}()

private lazy var withdrawAlertController: UIAlertController = {
let alertController = UIAlertController(title: "회원탈퇴", message: "7일내로 재로그인시 계정이 복구됩니다.\n정말 탈퇴하시겠어요?", preferredStyle: .alert)
let alertController = UIAlertController(title: "회원탈퇴", message: "7일 내로 재로그인시 계정이 복구됩니다.\n정말 탈퇴하시겠어요?", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "탈퇴", style: .destructive, handler: { [weak self] _ in
self?.interactor?.performUserWithdraw(request: Models.Withdraw.Request())
}))
Expand Down
12 changes: 6 additions & 6 deletions iOS/Layover/Layover/Scenes/SignUpScene/SignUpWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ extension SignUpWorker: SignUpWorkerProtocol {
authManager.refreshToken = data.refreshToken
authManager.isLoggedIn = true
authManager.loginType = .kakao
authManager.memberId = await fetchMemberId()
authManager.memberID = await fetchMemberId()
return true
} catch {
os_log(.error, log: .default, "Failed to sign up with error: %@", error.localizedDescription)
os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription)
return false
}
}
Expand All @@ -75,10 +75,10 @@ extension SignUpWorker: SignUpWorkerProtocol {
authManager.refreshToken = data.refreshToken
authManager.isLoggedIn = true
authManager.loginType = .apple
authManager.memberId = await fetchMemberId()
authManager.memberID = await fetchMemberId()
return true
} catch {
os_log(.error, log: .default, "Failed to sign up with error: %@", error.localizedDescription)
os_log(.error, log: .data, "Failed to sign up with error: %@", error.localizedDescription)
return false
}
}
Expand All @@ -88,12 +88,12 @@ extension SignUpWorker: SignUpWorkerProtocol {
do {
let responseData = try await provider.request(with: endPoint)
guard let data = responseData.data else {
os_log(.error, log: .default, "Failed to fetch member id with error: %@", responseData.message)
os_log(.error, log: .data, "Failed to fetch member id with error: %@", responseData.message)
return nil
}
return data.id
} catch {
os_log(.error, log: .default, "Failed to fetch member id with error: %@", error.localizedDescription)
os_log(.error, log: .data, "Failed to fetch member id with error: %@", error.localizedDescription)
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion iOS/Layover/Layover/Workers/Mocks/StubAuthManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ final class StubAuthManager: AuthManagerProtocol {
var refreshToken: String? = "Fake Refresh Token"
var isLoggedIn: Bool? = true
var loginType: LoginType? = .kakao
var memberId: Int? = 0
var memberID: Int? = -1
}

0 comments on commit a7be9c5

Please sign in to comment.