mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 01:08:31 +00:00
Added tests for expiration
This commit is contained in:
parent
e42720a446
commit
e662b445dd
4 changed files with 66 additions and 2 deletions
|
@ -391,7 +391,7 @@ std::error_code jwt_object::verify(
|
|||
auto p_exp = payload()
|
||||
.get_claim_value<uint64_t>(registered_claims::expiration);
|
||||
|
||||
if (p_exp < (curr_time + dparams.leeway)) {
|
||||
if (curr_time > (p_exp + dparams.leeway)) {
|
||||
ec = VerificationErrc::TokenExpired;
|
||||
return ec;
|
||||
}
|
||||
|
|
|
@ -762,7 +762,7 @@ public: // 'tors
|
|||
*
|
||||
* 4. headers : Can pass a initializer list of pairs or any associative
|
||||
* containers which models `MappingConcept` (see `meta::is_mapping_concept`)
|
||||
* to populate header. Not much use.
|
||||
* to populate header. Can be used to set JTI.
|
||||
*/
|
||||
template <typename... Args>
|
||||
jwt_object(Args&&... args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue