Skip to content

Commit 5fc7ee1

Browse files
committed
Nitpicks
1 parent d664a5f commit 5fc7ee1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/LiveKit/Auth/TokenSource.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public actor CachingTokenSource: TokenSource, Loggable {
173173
public init(
174174
_ source: TokenSource,
175175
store: TokenStore = InMemoryTokenStore(),
176-
validator: @escaping TokenValidator = { _, res in res.hasValidToken() }
176+
validator: @escaping TokenValidator = { _, response in response.hasValidToken() }
177177
) {
178178
self.source = source
179179
self.store = store
@@ -201,9 +201,9 @@ public actor CachingTokenSource: TokenSource, Loggable {
201201
}
202202

203203
/// Get the cached credentials
204-
/// - Returns: The cached credentials if found, nil otherwise
205-
public func getCachedCredentials() async -> CachingTokenSource.Cached? {
206-
await store.retrieve()
204+
/// - Returns: The cached token if found, nil otherwise
205+
public func cachedToken() async -> Token.Response? {
206+
await store.retrieve()?.1
207207
}
208208
}
209209

0 commit comments

Comments
 (0)