Skip to content

Commit

Permalink
Update to JWTKit Beta 2 (#152)
Browse files Browse the repository at this point in the history
Switch to Beta 2

Co-authored-by: Jaap Wijnen <jaap@passivelogic.com>
  • Loading branch information
ptoffy and Jaap Wijnen authored Mar 17, 2024
1 parent c4bafa0 commit 690a134
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
.library(name: "JWT", targets: ["JWT"]),
],
dependencies: [
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0-beta.1"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0-beta.2"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.92.0"),
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions Sources/JWT/Request+JWT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public extension Request {
try await self._request.application.jwt.keys.verify(message, as: Payload.self)
}

public func sign<Payload>(_ jwt: Payload, header: JWTHeader = .init()) async throws -> String
public func sign<Payload>(_ jwt: Payload, kid: JWKIdentifier? = nil, header: JWTHeader = .init()) async throws -> String
where Payload: JWTPayload
{
return try await self._request.application.jwt.keys.sign(jwt, header: header)
return try await self._request.application.jwt.keys.sign(jwt, kid: kid, header: header)
}
}
}
2 changes: 1 addition & 1 deletion Tests/JWTTests/JWTTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class JWTTests: XCTestCase {
)
// Return the signed JWT
return try await [
"token": req.jwt.sign(payload, header: ["kid": "a"]),
"token": req.jwt.sign(payload, kid: "a"),
]
}

Expand Down

0 comments on commit 690a134

Please sign in to comment.