You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am receiving an Internal server error when the token expires without any other useful message that helps me identify the error's cause.
E.g:
However, if I enable the "Enable GraphQL Debug Mode", it returns the cause (invalid-jwt) of the issue but there is a warning on that option not to allow that on the production environment.
Screenshot:
The status code is always 200 for both cases.
Is there anything I can do to receive the error on the production environment when sending an expired token?
The text was updated successfully, but these errors were encountered:
Hi, I have been struggling with the same problem and finally a found a possible solution, you can add an action to intercept the token error and send an UserError response instead a WP_Error, so you can read the response in the errors variable
add_action('graphql_before_resolve_field', function () {
$token = \WPGraphQL\JWT_Authentication\Auth::validate_token();
if (is_wp_error($token)) {
throw new \GraphQL\Error\UserError($token->get_error_code());
}
}, 0);
Hi guys,
I am receiving an
Internal server error
when the token expires without any other useful message that helps me identify the error's cause.E.g:
However, if I enable the "Enable GraphQL Debug Mode", it returns the cause (
invalid-jwt
) of the issue but there is a warning on that option not to allow that on the production environment.Screenshot:
The status code is always
200
for both cases.Is there anything I can do to receive the error on the production environment when sending an expired token?
The text was updated successfully, but these errors were encountered: