Support token providers in Bearer Auth middleware.

This commit is contained in:
javier committed 2026-10-25 17:04:22 +01:00
1 parent 2c0c050e30
commit d5035f9a3a
4 files changed
+109 -11

No files matched your search

@@ -25,6 +25,14 @@ let client = Client(
)
```
Tokens expire after 20 minutes at most. For longer-lived clients, pass a token provider instead, which is called on every request:
```swift
BearerAuthMiddleware {
try await tokenStore.validToken()
}
```
### Making API Calls
The ``Client`` conforms to ``APIProtocol``, which defines a method for every endpoint in the App Store Connect API. Each method accepts an `Input` value and returns an `Output` value with the response.