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)
274
274
struct tm * timeinfo ;
275
275
char buf [128 ];
276
276
277
- timeinfo = localtime (& curr_time );
277
+ timeinfo = localtime (& JWT_G ( not_before ) );
278
278
strftime (buf , sizeof (buf ), "Cannot handle token prior to %Y-%m-%d %H:%M:%S" , timeinfo );
279
279
err_msg = buf ;
280
280
}
@@ -288,7 +288,7 @@ int jwt_verify_body(char *body, zval *return_value)
288
288
struct tm * timeinfo ;
289
289
char buf [128 ];
290
290
291
- timeinfo = localtime (& curr_time );
291
+ timeinfo = localtime (& JWT_G ( iat ) );
292
292
strftime (buf , sizeof (buf ), "Cannot handle token prior to %Y-%m-%d %H:%M:%S" , timeinfo );
293
293
err_msg = buf ;
294
294
}
Original file line number Diff line number Diff line change 12
12
"admin " => true
13
13
],
14
14
"sub " => "1234567890 " ,
15
- "nbf " => time () + 10
15
+ "nbf " => time () + 100
16
16
);
17
17
18
18
// default HS256 algorithm
19
19
$ token = jwt_encode ($ claims , $ key );
20
20
21
21
echo $ 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