Skip to content

Commit

Permalink
Merge pull request #65 from eu-digital-identity-wallet/bugfix/proof-j…
Browse files Browse the repository at this point in the history
…wt-is-empty-string

[fix] filter empty content in jwt
  • Loading branch information
dtsiflit authored Jul 17, 2024
2 parents c60e7de + 9b2caa2 commit 9fe7a42
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Sources/Entities/Encryption/BindingKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ public extension BindingKey {
JWTClaimNames.audience: aud,
JWTClaimNames.nonce: cNonce ?? "",
JWTClaimNames.issuer: issuer ?? ""
]
].filter { key, value in
if let string = value as? String, string.isEmpty {
return false
}
return true
}

let payload = Payload(try dictionary.toThrowingJSONData())

Expand Down Expand Up @@ -126,7 +131,12 @@ public extension BindingKey {
JWTClaimNames.audience: aud,
JWTClaimNames.nonce: cNonce ?? "",
JWTClaimNames.issuer: issuer ?? ""
]
].filter { key, value in
if let string = value as? String, string.isEmpty {
return false
}
return true
}

let payload = Payload(try dictionary.toThrowingJSONData())

Expand Down

0 comments on commit 9fe7a42

Please sign in to comment.