From 6b1d48c28bb64abbe3f83028aa27d5e2cc94d9fd Mon Sep 17 00:00:00 2001 From: "genaro.arvizu" Date: Thu, 5 Oct 2023 21:40:06 -0500 Subject: [PATCH] FernoConfiguration.tokenExpirationDate typo fixed --- Sources/Ferno/FernoClient.swift | 4 ++-- Sources/Ferno/FernoConfiguration.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Ferno/FernoClient.swift b/Sources/Ferno/FernoClient.swift index 0929e8d..5cd8efc 100644 --- a/Sources/Ferno/FernoClient.swift +++ b/Sources/Ferno/FernoClient.swift @@ -123,7 +123,7 @@ extension FernoAPIClient { if let cachedToken = lock.withLock({ if let accessToken = configuration.accessToken, - let tokenExpriationDate = configuration.tokenExpriationDate, + let tokenExpriationDate = configuration.tokenExpirationDate, Date().timeIntervalSince(tokenExpriationDate) > 30*60 { // should be valid for 1 hour return accessToken } else { @@ -151,7 +151,7 @@ extension FernoAPIClient { let res = try await client.send(req).content.decode(OAuthResponse.self) lock.withLockVoid { self.configuration.accessToken = res.access_token - self.configuration.tokenExpriationDate = Date().addingTimeInterval(TimeInterval(res.expires_in)) + self.configuration.tokenExpirationDate = Date().addingTimeInterval(TimeInterval(res.expires_in)) } self.configuration.logger.debug("Access token received") return res.access_token diff --git a/Sources/Ferno/FernoConfiguration.swift b/Sources/Ferno/FernoConfiguration.swift index 79bbcb1..15aed01 100644 --- a/Sources/Ferno/FernoConfiguration.swift +++ b/Sources/Ferno/FernoConfiguration.swift @@ -13,21 +13,21 @@ public struct FernoConfiguration { public let email: String public let privateKey: String public var accessToken: String? - public var tokenExpriationDate: Date? + public var tokenExpirationDate: Date? public init( basePath: String, email: String, privateKey: String, accessToken: String? = nil, - tokenExpriationDate: Date? = nil, + tokenExpirationDate: Date? = nil, logger: Logger = .init(label: "codes.vapor.ferno") ) { self.basePath = basePath self.email = email self.privateKey = privateKey self.accessToken = accessToken - self.tokenExpriationDate = tokenExpriationDate + self.tokenExpirationDate = tokenExpirationDate self.logger = logger } }