mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
correcting decoded_jwt + builder api breaks
- decoded_jwt to expose get_payload_claims() and get_header_claims() - builder set expires, not_before and issued correctly pass date as an arg
This commit is contained in:
@@ -46,6 +46,8 @@ YwIDAQAB
|
||||
.set_type("JWT")
|
||||
.set_id("rsa-create-example")
|
||||
.set_issued_at(std::chrono::system_clock::now())
|
||||
.set_expires_at(std::chrono::system_clock::now() + std::chrono::seconds{36000})
|
||||
.set_payload_claim("sample", jwt::claim(std::string{"test"}))
|
||||
.sign(jwt::algorithm::rs256(rsa_pub_key, rsa_priv_key, "", ""));
|
||||
|
||||
std::cout << "token:\n" << token << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user