Skip to content

Commit 690a134

Browse files
ptoffyJaap Wijnen
and
Jaap Wijnen
authored
Update to JWTKit Beta 2 (#152)
Switch to Beta 2 Co-authored-by: Jaap Wijnen <[email protected]>
1 parent c4bafa0 commit 690a134

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
.library(name: "JWT", targets: ["JWT"]),
1414
],
1515
dependencies: [
16-
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0-beta.1"),
16+
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0-beta.2"),
1717
.package(url: "https://github.com/vapor/vapor.git", from: "4.92.0"),
1818
],
1919
targets: [

Sources/JWT/Request+JWT.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public extension Request {
3434
try await self._request.application.jwt.keys.verify(message, as: Payload.self)
3535
}
3636

37-
public func sign<Payload>(_ jwt: Payload, header: JWTHeader = .init()) async throws -> String
37+
public func sign<Payload>(_ jwt: Payload, kid: JWKIdentifier? = nil, header: JWTHeader = .init()) async throws -> String
3838
where Payload: JWTPayload
3939
{
40-
return try await self._request.application.jwt.keys.sign(jwt, header: header)
40+
return try await self._request.application.jwt.keys.sign(jwt, kid: kid, header: header)
4141
}
4242
}
4343
}

Tests/JWTTests/JWTTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class JWTTests: XCTestCase {
8484
)
8585
// Return the signed JWT
8686
return try await [
87-
"token": req.jwt.sign(payload, header: ["kid": "a"]),
87+
"token": req.jwt.sign(payload, kid: "a"),
8888
]
8989
}
9090

0 commit comments

Comments
 (0)