PHP code example of wp-graphql / wp-graphql-jwt-authentication

1. Go to this page and download the library: Download wp-graphql/wp-graphql-jwt-authentication library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wp-graphql / wp-graphql-jwt-authentication example snippets


function custom_jwt_expiration( $expiration ) {
    return 60;
}

add_filter('graphql_jwt_auth_expire', 'custom_jwt_expiration', 10);

add_filter( 'graphql_jwt_auth_secret_key', function() {
  return 'your-secret-token';
});