-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat/#114] 로그인 API 연결, 키체인 등록
- Loading branch information
Showing
15 changed files
with
244 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+20.8 KB
(100%)
...eproj/project.xcworkspace/xcuserdata/leejinhee.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// KeychainHelper.swift | ||
// MatQ_Admin | ||
// | ||
// Created by Lee Jinhee on 1/9/25. | ||
// | ||
|
||
import Foundation | ||
import Security | ||
|
||
class KeychainHelper { | ||
static let shared = KeychainHelper() | ||
|
||
private init() {} | ||
|
||
func save(key: String, value: String) { | ||
let data = value.data(using: .utf8)! | ||
let query = [ | ||
kSecClass: kSecClassGenericPassword, | ||
kSecAttrAccount: key, | ||
kSecValueData: data | ||
] as CFDictionary | ||
|
||
SecItemDelete(query) // 기존 데이터 제거 | ||
SecItemAdd(query, nil) | ||
} | ||
|
||
func retrieve(key: String) -> String? { | ||
let query = [ | ||
kSecClass: kSecClassGenericPassword, | ||
kSecAttrAccount: key, | ||
kSecReturnData: true, | ||
kSecMatchLimit: kSecMatchLimitOne | ||
] as CFDictionary | ||
|
||
var result: AnyObject? | ||
if SecItemCopyMatching(query, &result) == errSecSuccess, | ||
let data = result as? Data { | ||
return String(data: data, encoding: .utf8) | ||
} | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// AuthModel.swift | ||
// MatQ_Admin | ||
// | ||
// Created by Lee Jinhee on 12/27/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct PostAuthRequest: Encodable { | ||
let userType: String = "ADMIN" | ||
let accessToken: String = "accessToken" | ||
let refreshToken: String = "refreshToken" | ||
let email: String = "admin" | ||
let channel: String = "KAKAO" | ||
} | ||
|
||
struct PostAuthResponse: Decodable { | ||
let authorization: String? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.