Skip to content

Commit

Permalink
0.42.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dankinsoid committed Mar 11, 2024
1 parent 7adbec3 commit 0087c2b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 152 deletions.
90 changes: 0 additions & 90 deletions Example/Sources/PetStore/CustomAuth.swift

This file was deleted.

1 change: 1 addition & 0 deletions Example/Sources/PetStore/ExampleOfCalls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func exampleOfAPICalls() async throws {
_ = try await api().user("name").delete()
}

/// In order to get actual #line and #fileID in loggs use the following function instead of variable.
func api(fileID: String = #fileID, line: UInt = #line) -> PetStore {
PetStore(baseURL: .production, fileID: fileID, line: line)
}
61 changes: 0 additions & 61 deletions Example/Sources/PetStore/TokenRefresher.swift

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ import PackageDescription
let package = Package(
name: "SomeProject",
dependencies: [
.package(url: "https://github.com/dankinsoid/swift-api-client.git", from: "0.41.0")
.package(url: "https://github.com/dankinsoid/swift-api-client.git", from: "0.42.0")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public struct TokenRefresherMiddleware: HTTPClientMiddleware {
configs: APIClient.Configs,
next: (URLRequest, APIClient.Configs) async throws -> (T, HTTPURLResponse)
) async throws -> (T, HTTPURLResponse) {
guard configs.isAuthEnabled else {
return try await next(request, configs)
}
var token: String
let currentToken = tokenCacheService.getToken()
if let currentToken {
Expand Down

0 comments on commit 0087c2b

Please sign in to comment.