arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
393 stars 112 forks source link

Asymmetric API - can set system_time_t, but not get #70

Open GeneratedNickname opened 4 years ago

GeneratedNickname commented 4 years ago

The method add_claim has an overload for system_time_t, but get_claim_value does not. One would expect symmetry in that regard.

obj.add_claim(jwt::registered_claims::issued_at, chrono::system_clock::now());
auto iat = obj.payload().get_claim_value<chrono::system_clock::time_point>(jwt::registered_claims::issued_at); // Does not compile.
arun11299 commented 3 years ago

Thanks! Do you want to send a pull request for it ?

GeneratedNickname commented 3 years ago

If that helps I probably can. Whatever works best for you.