mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-06-07 21:15:18 +00:00
COVIDSafe code from version 2.4 (#47)
This commit is contained in:
parent
e577a9e7aa
commit
1478088e19
40 changed files with 1125 additions and 657 deletions
|
@ -61,16 +61,20 @@ enum CovidSafeAPIError: Error {
|
|||
|
||||
class CovidSafeAuthenticatedAPI {
|
||||
|
||||
static func authenticatedHeaders() throws -> HTTPHeaders? {
|
||||
let keychain = KeychainSwift()
|
||||
|
||||
guard let token = keychain.get("JWT_TOKEN") else {
|
||||
throw CovidSafeAPIError.TokenExpiredError
|
||||
static var isBusy = false
|
||||
|
||||
static var authenticatedHeaders: HTTPHeaders {
|
||||
get {
|
||||
let keychain = KeychainSwift()
|
||||
|
||||
guard let token = keychain.get("JWT_TOKEN") else {
|
||||
return []
|
||||
}
|
||||
let headers: HTTPHeaders = [
|
||||
"Authorization": "Bearer \(token)"
|
||||
]
|
||||
return headers
|
||||
}
|
||||
let headers: HTTPHeaders = [
|
||||
"Authorization": "Bearer \(token)"
|
||||
]
|
||||
return headers
|
||||
}
|
||||
|
||||
static func processUnauthorizedError(_ data: Data) -> CovidSafeAPIError {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue