Skip to content

Commit e69b4b4

Browse files
committed
- Bail in determine_current_user filter if it's not a GraphQL HTTP Request
1 parent 0453444 commit e69b4b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

wp-graphql-jwt-authentication.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ function init() {
200200

201201
add_filter( 'determine_current_user', function( $user ) {
202202

203+
/**
204+
* Bail if it's not a GraphQL HTTP Request
205+
*
206+
* @todo: consider supporting REST too?
207+
*/
208+
if ( ! defined( 'GRAPHQL_HTTP_REQUEST' ) || false === GRAPHQL_HTTP_REQUEST ) {
209+
return $user;
210+
}
211+
203212
/**
204213
* Validate the token, which will check the Headers to see if Authentication headers were sent
205214
*

0 commit comments

Comments
 (0)