kylef / JSONWebToken.swift

Swift implementation of JSON Web Token (JWT).
http://jwt.io
BSD 2-Clause "Simplified" License
763 stars 226 forks source link

Problem #97

Open obozhdi opened 6 years ago

obozhdi commented 6 years ago
screen shot 2017-12-30 at 21 12 43

Just a simple method in 2 different projects. First working fine, second wont compile. Any ideas?

guykogus commented 6 years ago

You need to encapsulate your claims using the ClaimSet struct.

return JWT.encode(claims: ClaimSet(claims: [...],
   algorithm: .hs256("SOME SECRET STRING".data(using: .utf8)!)