Skip to content

Commit 25390c2

Browse files
authored
Merge pull request #28 from wp-graphql/feature/#26-expose-jwt-refresh-in-rest-response-headers
#26 - remove unused filter that was causing issues with expiration dates
2 parents ce2341c + da0b76c commit 25390c2

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/ManageTokens.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ public static function init() {
4141
'prevent_token_from_returning_if_revoked'
4242
], 10, 2 );
4343

44-
/**
45-
* Filter the expiration to use the user's expiration if a custom expiration has been set.
46-
*/
47-
add_filter( 'graphql_jwt_auth_expire', [
48-
'\WPGraphQL\JWT_Authentication\ManageTokens',
49-
'use_custom_user_expiration'
50-
] );
51-
5244
add_filter( 'graphql_response_headers_to_send', [
5345
'\WPGraphQL\JWT_Authentication\ManageTokens',
5446
'add_tokens_to_graphql_response_headers'
@@ -259,30 +251,6 @@ public static function prevent_token_from_returning_if_revoked( $token, $user_id
259251

260252
}
261253

262-
263-
public static function use_custom_user_expiration( $expiration ) {
264-
265-
$user = wp_get_current_user();
266-
267-
/**
268-
* If there is no current user set or the current user's secret has been revoked, return null
269-
*/
270-
if ( 0 === $user->ID || Auth::is_jwt_secret_revoked( $user->ID ) ) {
271-
return null;
272-
}
273-
274-
/**
275-
* If the user has custom expiration configured, use it
276-
*/
277-
$user_expiration = get_user_meta( $user->ID, 'graphql_jwt_custom_expiration', true );
278-
if ( ! empty( $user_expiration ) && is_string( $user_expiration ) ) {
279-
$expiration = $user_expiration;
280-
}
281-
282-
return $expiration;
283-
284-
}
285-
286254
/**
287255
* Returns tokens in the response headers
288256
*

0 commit comments

Comments
 (0)