Skip to content

Commit 7d08911

Browse files
authored
Merge pull request #308 from teamterning/#307-로그인로직수정
[Fix] #307 - 로그인 로직 서버 요청에 따라 수정 했습니다.
2 parents 8a0b4f3 + 088b304 commit 7d08911

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# 👔 terning 터닝 - 대학생 인턴, 공고 관리 캘린더
55

6-
## 앱스토어 링크 : [앱스토어](https://apps.apple.com/kr/app/terning-%ED%84%B0%EB%8B%9D-%EB%8C%80%ED%95%99%EC%83%9D-%EC%9D%B8%ED%84%B4-%EA%B3%B5%EA%B3%A0-%EA%B4%80%EB%A6%AC-%EC%BA%98%EB%A6%B0%EB%8D%94/id6547866420) v1.5.0
6+
## 앱스토어 링크 : [앱스토어](https://apps.apple.com/kr/app/terning-%ED%84%B0%EB%8B%9D-%EB%8C%80%ED%95%99%EC%83%9D-%EC%9D%B8%ED%84%B4-%EA%B3%B5%EA%B3%A0-%EA%B4%80%EB%A6%AC-%EC%BA%98%EB%A6%B0%EB%8D%94/id6547866420) v1.6.0
77
<p align="left"><img width="900" src="https://github.com/user-attachments/assets/984e7795-3746-4e7a-ad6c-cb1cb376c481"></p>
88

99
**내 계획에 딱 맞는 대학생 인턴의 시작, 터닝**

Terning-iOS/Terning-iOS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@
20242024
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
20252025
CODE_SIGN_IDENTITY = "Apple Development";
20262026
CODE_SIGN_STYLE = Automatic;
2027-
CURRENT_PROJECT_VERSION = 2025.0603.1653;
2027+
CURRENT_PROJECT_VERSION = 2025.0622.0331;
20282028
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
20292029
ENABLE_USER_SCRIPT_SANDBOXING = NO;
20302030
GENERATE_INFOPLIST_FILE = YES;
@@ -2041,7 +2041,7 @@
20412041
"$(inherited)",
20422042
"@executable_path/Frameworks",
20432043
);
2044-
MARKETING_VERSION = 1.5.0;
2044+
MARKETING_VERSION = 1.6.0;
20452045
OTHER_LDFLAGS = (
20462046
"-Xlinker",
20472047
"-interposable",
@@ -2068,7 +2068,7 @@
20682068
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
20692069
CODE_SIGN_IDENTITY = "Apple Development";
20702070
CODE_SIGN_STYLE = Automatic;
2071-
CURRENT_PROJECT_VERSION = 2025.0603.1653;
2071+
CURRENT_PROJECT_VERSION = 2025.0622.0331;
20722072
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
20732073
ENABLE_USER_SCRIPT_SANDBOXING = NO;
20742074
GENERATE_INFOPLIST_FILE = YES;
@@ -2085,7 +2085,7 @@
20852085
"$(inherited)",
20862086
"@executable_path/Frameworks",
20872087
);
2088-
MARKETING_VERSION = 1.5.0;
2088+
MARKETING_VERSION = 1.6.0;
20892089
PRODUCT_BUNDLE_IDENTIFIER = "com.terning.Terning-iOS";
20902090
PRODUCT_NAME = "$(TARGET_NAME)";
20912091
PROVISIONING_PROFILE_SPECIFIER = "";

Terning-iOS/Terning-iOS/Application/SceneDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,5 @@ extension SceneDelegate {
153153

154154
extension Notification.Name {
155155
static let didChangePushPermission = Notification.Name("didChangePushPermission")
156+
static let didReceiveRateLimit = Notification.Name("didReceiveRateLimit")
156157
}

Terning-iOS/Terning-iOS/Data/Network/User/UserManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ final class UserManager {
7979
print("🍎🍎🍎🍎\(error.localizedDescription)")
8080
completion(.failure(.networkFail))
8181
}
82+
} else if status == 429 {
83+
print("🚫 429 Too Many Requests")
84+
NotificationCenter.default.post(name: .didReceiveRateLimit, object: nil)
85+
completion(.failure(.networkFail))
8286
} else if status >= 400 {
8387
print("400 error")
8488
completion(.failure(.networkFail))

Terning-iOS/Terning-iOS/Presentation/Login/ViwController/LoginViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ final class LoginViewController: UIViewController {
4545
setUI()
4646
setLayout()
4747
bindViewModel()
48+
observeRateLimit()
4849
}
4950
}
5051

@@ -106,4 +107,22 @@ extension LoginViewController {
106107
ViewControllerUtils.setRootViewController(window: window, viewController: profileViewVC, withAnimation: true)
107108
}
108109
}
110+
111+
private func observeRateLimit() {
112+
NotificationCenter.default.addObserver(
113+
forName: .didReceiveRateLimit,
114+
object: nil,
115+
queue: .main
116+
) { [weak self] _ in
117+
self?.loginView.kakaoLoginButton.isEnabled = false
118+
self?.loginView.appleLoginButton.isEnabled = false
119+
120+
self?.showToast(message: "요청이 너무 많습니다. 잠시 후 다시 시도해 주세요.")
121+
122+
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
123+
self?.loginView.kakaoLoginButton.isEnabled = true
124+
self?.loginView.appleLoginButton.isEnabled = true
125+
}
126+
}
127+
}
109128
}

0 commit comments

Comments
 (0)