Skip to content
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

[Feat] make keychain #183

Merged
merged 4 commits into from
Jul 16, 2024
Merged

[Feat] make keychain #183

merged 4 commits into from
Jul 16, 2024

Conversation

hooni0918
Copy link
Member

πŸ”— μ—°κ²°λœ 이슈

πŸ“„ μž‘μ—… λ‚΄μš©

  • KeychainAccessible κ΅¬ν˜„
  • KeychainService κ΅¬ν˜„
  • λ‘œκ·ΈμΈμ‹œ μ—‘μ„ΈμŠ€ν† ν° + λ¦¬ν”„λ ˆμ‹œ 토큰 μ €μž₯

@hooni0918 hooni0918 added ✨ feat κΈ°λŠ₯ κ΅¬ν˜„μ‹œ μ‚¬μš© 🧑 JiHoon μŒˆλ½•ν•œ ν”ŒλŸ¬νŒ… κΏ€νŒμ„ λ“£κ³  μ‹Άλ‹€λ©΄ labels Jul 15, 2024
@hooni0918 hooni0918 self-assigned this Jul 15, 2024
@hooni0918 hooni0918 changed the title Feat/#182 make keychain [Feat] make keychain Jul 15, 2024
Copy link
Member

@youz2me youz2me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€! μž‘μ—… 속도가 μ—„μ²­ λΉ λ₯΄μ‹œλ„€μš” ,,,

Copy link
Contributor

@JinUng41 JinUng41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM πŸ‘

Comment on lines 24 to 27
private struct Key {
static let accessToken = "accessToken"
static let refreshToken = "refreshToken"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

structλŠ” 생성이 κ°€λŠ₯ν•˜κΈ° λ•Œλ¬Έμ—, 일반적으둜 enum으둜 μ„ μ–Έν•˜κ³€ ν•œλ‹΅λ‹ˆλ‹€.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ν—‰ μ°Έκ³ ν•˜κ²ŸμŠ΅λ‹ˆλ‹€!

Comment on lines 32 to 33
print("Keychain initialized with service name: \(serviceName)")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 뢀뢄은 μ‚­μ œν•΄λ„ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ°˜μ˜μ™„

Comment on lines 42 to 60
if let newValue = newValue {
let success = keychain.set(newValue, forKey: Key.accessToken)
print("Setting Access Token: \(newValue)")
if success {
print("Access Token saved successfully")
// μ €μž₯ ν›„ μ¦‰μ‹œ 읽어 확인
if let savedToken = keychain.string(forKey: Key.accessToken) {
print("Verified Access Token: \(savedToken)")
} else {
print("Failed to verify Access Token after saving")
}
} else {
print("Failed to save Access Token")
printKeychainError(forKey: Key.accessToken)
}
} else {
let success = keychain.removeObject(forKey: Key.accessToken)
print(success ? "Access Token removed successfully" : "Failed to remove Access Token")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뎁슀 μ’€ μ€„μ—¬μ£Όμ„Έμš”!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ°˜μ˜μ™„

Comment on lines 71 to 89
if let newValue = newValue {
let success = keychain.set(newValue, forKey: Key.refreshToken)
print("Setting Refresh Token: \(newValue)")
if success {
print("Refresh Token saved successfully")
// μ €μž₯ ν›„ μ¦‰μ‹œ 읽어 확인
if let savedToken = keychain.string(forKey: Key.refreshToken) {
print("Verified Refresh Token: \(savedToken)")
} else {
print("Failed to verify Refresh Token after saving")
}
} else {
print("Failed to save Refresh Token")
printKeychainError(forKey: Key.refreshToken)
}
} else {
let success = keychain.removeObject(forKey: Key.refreshToken)
print(success ? "Refresh Token removed successfully" : "Failed to remove Refresh Token")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 뎁슀 μ€„μ—¬μ£Όμ„Έμš”!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ°˜μ˜μ™„

@hooni0918 hooni0918 merged commit 1952189 into suyeon Jul 16, 2024
@hooni0918 hooni0918 deleted the feat/#182-makeKeychain branch July 16, 2024 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feat κΈ°λŠ₯ κ΅¬ν˜„μ‹œ μ‚¬μš© 🧑 JiHoon μŒˆλ½•ν•œ ν”ŒλŸ¬νŒ… κΏ€νŒμ„ λ“£κ³  μ‹Άλ‹€λ©΄
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants