Closed prafullwizorbit closed 5 years ago
ok i found the answer actually jwt checking well for token expiry but it should be return in same way as token validate state like this way my code working well } catch (Exception $e) { /* Something is wrong trying to decode the token, send back the error / return array( 'code' => 'jwt_auth_invalid_token', 'data' => array( 'code' => $e->getMessage(), 'status' => 403, ), ); }
Hello i think i am facing a problem what happened with me, this plugin was working well but after 7 days there is no any response from token validate function, because after 7 days still token is present in cookie but it is expired & when this is served as bearer then validate_token function doesn't give any response. this may be because there is no any condition is set for checking expiry time in validate_token function that exist in class-jwt-auth-public.php
Here is function ` public function validate_token($output = true) { /*
return the user. */ $auth = isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : false;
if the format is wrong return the user. */ list($token) = sscanf($auth, 'Bearer %s'); if (!$token) { return new WP_Error( 'jwt_auth_bad_auth_header', 'Authorization header malformed.', array( 'status' => 403, ) ); }
}`
Can any one help me how to validate expiry token in every bearer token request.
Thanks.