-
Notifications
You must be signed in to change notification settings - Fork 1
[Fix] 토큰 재발급 role 추가 #42
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
Changes from all commits
eb284c1
4c36266
aa864c7
3b9bd73
9d710eb
8bf4c2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,24 +22,26 @@ final class UserDataRepository: UserDataRepositoryProtocol { | |
| return user.nickname | ||
| } | ||
|
|
||
| func reissueToken() async -> Bool { | ||
| func reissueToken() async -> UserState? { | ||
| do { | ||
| let refreshToken = try tokenManager.loadToken(tokenType: .refreshToken) | ||
| let endpoint = AuthEndpoint.reissue(refreshToken: refreshToken) | ||
|
|
||
| guard let tokenResponse = try await networkService.request(endpoint: endpoint, type: TokenResponseDTO.self) | ||
| else { return false } | ||
| guard let loginResponse = try await networkService.request(endpoint: endpoint, type: LoginResponseDTO.self) | ||
| else { return nil } | ||
|
|
||
| try tokenManager.saveToken(token: tokenResponse.accessToken, tokenType: .accessToken) | ||
| try tokenManager.saveToken(token: tokenResponse.refreshToken, tokenType: .refreshToken) | ||
| try tokenManager.saveToken(token: loginResponse.accessToken, tokenType: .accessToken) | ||
| try tokenManager.saveToken(token: loginResponse.refreshToken, tokenType: .refreshToken) | ||
|
|
||
| BitnagilLogger.log(logType: .debug, message: "AccessToken Saved: \(tokenResponse.accessToken)") | ||
| BitnagilLogger.log(logType: .debug, message: "RefreshToken Saved: \(tokenResponse.refreshToken)") | ||
| BitnagilLogger.log(logType: .debug, message: "AccessToken Saved: \(loginResponse.accessToken)") | ||
| BitnagilLogger.log(logType: .debug, message: "RefreshToken Saved: \(loginResponse.refreshToken)") | ||
| BitnagilLogger.log(logType: .debug, message: "User State: \(loginResponse.userState)") | ||
|
|
||
| return true | ||
| let userState = UserState(rawValue: loginResponse.userState) | ||
| return userState | ||
| } catch { | ||
| BitnagilLogger.log(logType: .error, message: "\(error.localizedDescription)") | ||
| return false | ||
| return nil | ||
| } | ||
|
Comment on lines
+25
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 오류 흐름과 반환값 의미를 분리하면 호출부가 더 안전해집니다 현재 실패 시
🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,5 +12,5 @@ public protocol UserDataRepositoryProtocol { | |
| func loadNickname() async throws -> String | ||
|
|
||
| /// 토큰 재발급을 진행합니다. | ||
| func reissueToken() async -> Bool | ||
| func reissueToken() async -> UserState? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |||||||||||||
| <key>CFBundlePackageType</key> | ||||||||||||||
| <string>APPL</string> | ||||||||||||||
| <key>CFBundleShortVersionString</key> | ||||||||||||||
| <string>0.0.1</string> | ||||||||||||||
| <string>0.0.3</string> | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainInfo.plist에 버전 하드코딩 대신 MARKETING_VERSION/CURRENT_PROJECT_VERSION 사용 권장
변경 제안(해당 라인 교체): - <string>0.0.3</string>
+ <string>$(MARKETING_VERSION)</string>CFBundleVersion도 함께 변수화 권장(파일 내 다른 위치, 참고용 XML): <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>버전 일관성 검증 스크립트: 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Info.plist 버전 값 점검 =="
fd -a 'Info.plist' | while read -r f; do
echo "---- $f"
rg -n -A 1 '<key>CFBundleShortVersionString</key>|<key>CFBundleVersion</key>' "$f" || true
doneLength of output: 484 Info.plist 버전 하드코딩 제거 및 변수화 적용 필요
변경 제안(diff): --- a/SupportingFiles/Info.plist
+++ b/SupportingFiles/Info.plist
@@ -17,4 +17,4 @@
<key>CFBundleShortVersionString</key>
- <string>0.0.3</string>
+ <string>$(MARKETING_VERSION)</string>
@@ -30,4 +30,4 @@
<key>CFBundleVersion</key>
- <string>1</string>
+ <string>$(CURRENT_PROJECT_VERSION)</string>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| <key>CFBundleURLTypes</key> | ||||||||||||||
| <array> | ||||||||||||||
| <dict> | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
토큰 값을 그대로 로그에 출력하면 보안 위험이 큽니다
accessToken,refreshToken을 디버그 로그에 남기면 콘솔 공유·크래시 리포트 업로드 시 유출될 수 있습니다.운영 빌드에서는 마스킹하거나 완전히 제거해 주세요.
🤖 Prompt for AI Agents