File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ extension FernoAPIClient {
123
123
124
124
if let cachedToken = lock. withLock ( {
125
125
if let accessToken = configuration. accessToken,
126
- let tokenExpriationDate = configuration. tokenExpriationDate ,
126
+ let tokenExpriationDate = configuration. tokenExpirationDate ,
127
127
Date ( ) . timeIntervalSince ( tokenExpriationDate) > 30 * 60 { // should be valid for 1 hour
128
128
return accessToken
129
129
} else {
@@ -151,7 +151,7 @@ extension FernoAPIClient {
151
151
let res = try await client. send ( req) . content. decode ( OAuthResponse . self)
152
152
lock. withLockVoid {
153
153
self . configuration. accessToken = res. access_token
154
- self . configuration. tokenExpriationDate = Date ( ) . addingTimeInterval ( TimeInterval ( res. expires_in) )
154
+ self . configuration. tokenExpirationDate = Date ( ) . addingTimeInterval ( TimeInterval ( res. expires_in) )
155
155
}
156
156
self . configuration. logger. debug ( " Access token received " )
157
157
return res. access_token
Original file line number Diff line number Diff line change @@ -13,21 +13,21 @@ public struct FernoConfiguration {
13
13
public let email : String
14
14
public let privateKey : String
15
15
public var accessToken : String ?
16
- public var tokenExpriationDate : Date ?
16
+ public var tokenExpirationDate : Date ?
17
17
18
18
public init (
19
19
basePath: String ,
20
20
email: String ,
21
21
privateKey: String ,
22
22
accessToken: String ? = nil ,
23
- tokenExpriationDate : Date ? = nil ,
23
+ tokenExpirationDate : Date ? = nil ,
24
24
logger: Logger = . init( label: " codes.vapor.ferno " )
25
25
) {
26
26
self . basePath = basePath
27
27
self . email = email
28
28
self . privateKey = privateKey
29
29
self . accessToken = accessToken
30
- self . tokenExpriationDate = tokenExpriationDate
30
+ self . tokenExpirationDate = tokenExpirationDate
31
31
self . logger = logger
32
32
}
33
33
}
You can’t perform that action at this time.
0 commit comments