Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Updated claims JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmya committed Jun 2, 2017
1 parent 0871a20 commit a9c9091
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sources/VaporAPNS/VaporAPNS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ open class VaporAPNS {
var curlHeaders: UnsafeMutablePointer<curl_slist>?
if !options.usesCertificateAuthentication {
let privateKey = options.privateKey!.bytes.base64Decoded
let claims: [Node] = [
IssuerClaim(string: options.teamId!).node,
IssuedAtClaim().node
let claims: [Claim] = [
IssuerClaim(string: options.teamId!),
IssuedAtClaim()
]
let claimsPayload = try! claims.makeNode(in: nil).converted(to: JSON.self)
let jwt = try! JWT(additionalHeaders: [KeyID(options.keyId!)],
payload: claimsPayload,
payload: JSON(claims),
signer: ES256(key: privateKey))

let tokenString = try! jwt.createToken()
Expand Down

0 comments on commit a9c9091

Please sign in to comment.