Skip to content

Commit

Permalink
Merge pull request #1 from lukaskasa/patch-1
Browse files Browse the repository at this point in the history
Missing typ field in the header vapor#5
  • Loading branch information
Maxim-Inv authored Jun 25, 2020
2 parents b5aa3d4 + 992c74c commit ea4c0dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/JWTKit/JWTSerializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ struct JWTSerializer {
func sign<Payload>(
_ payload: Payload,
using signer: JWTSigner,
typ: String = "JWT",
kid: JWKIdentifier? = nil
) throws -> String
where Payload: JWTPayload
Expand All @@ -14,6 +15,7 @@ struct JWTSerializer {
// encode header, copying header struct to mutate alg
var header = JWTHeader()
header.kid = kid
header.typ = typ
header.alg = signer.algorithm.name

let headerData = try jsonEncoder.encode(header)
Expand Down

0 comments on commit ea4c0dc

Please sign in to comment.