File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ int jwt_verify_body(char *body, zval *return_value)
274274 struct tm * timeinfo ;
275275 char buf [128 ];
276276
277- timeinfo = localtime (& curr_time );
277+ timeinfo = localtime (& JWT_G ( not_before ) );
278278 strftime (buf , sizeof (buf ), "Cannot handle token prior to %Y-%m-%d %H:%M:%S" , timeinfo );
279279 err_msg = buf ;
280280 }
@@ -288,7 +288,7 @@ int jwt_verify_body(char *body, zval *return_value)
288288 struct tm * timeinfo ;
289289 char buf [128 ];
290290
291- timeinfo = localtime (& curr_time );
291+ timeinfo = localtime (& JWT_G ( iat ) );
292292 strftime (buf , sizeof (buf ), "Cannot handle token prior to %Y-%m-%d %H:%M:%S" , timeinfo );
293293 err_msg = buf ;
294294 }
Original file line number Diff line number Diff line change 1212 "admin " => true
1313 ],
1414 "sub " => "1234567890 " ,
15- "nbf " => time () + 10
15+ "nbf " => time () + 100
1616);
1717
1818// default HS256 algorithm
1919$ token = jwt_encode ($ claims , $ key );
2020
2121echo $ token . PHP_EOL ;
22- print_r (jwt_decode ($ token , $ key , ['leeway ' => 20 , "iss " => "http://example.org " ]));
22+ print_r (jwt_decode ($ token , $ key , ['leeway ' => 2 , "iss " => "http://example.org " ]));
You can’t perform that action at this time.
0 commit comments