Skip to content

Commit

Permalink
Update FernoRequest.swift
Browse files Browse the repository at this point in the history
hot fix
  • Loading branch information
AAAstorga authored Jul 11, 2018
1 parent 80f0fcb commit 8e69f6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Ferno/FernoRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ extension FernoAPIRequest {
}

private func getAccessToken() throws -> Future<String> {
if let expireDate = self.expireDate, Calendar.current.compare(expireDate, to: Date(timeIntervalSinceNow: -120), toGranularity: .second) == .orderedDescending {
guard let accessToken = self.accessToken else { throw FernoError.invalidAccessToken }
return Future.map(on: self.httpClient.container) { accessToken }
}
//if let expireDate = self.expireDate, Calendar.current.compare(expireDate, to: Date(timeIntervalSinceNow: -120), toGranularity: .second) == .orderedDescending {
// guard let accessToken = self.accessToken else { throw FernoError.invalidAccessToken }
// return Future.map(on: self.httpClient.container) { accessToken }
//}
//we need to refresh the token
let jwt = try createJWT()
var headers = HTTPHeaders()
Expand Down

0 comments on commit 8e69f6e

Please sign in to comment.