Skip to content

Commit e660b65

Browse files
committed
no message
1 parent 9df6cf5 commit e660b65

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Auth.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,14 @@ public static function validate_token( $token = null, $refresh = false ) {
588588
* The Token is decoded now validate the iss
589589
*/
590590
if ( ! isset( $token->iss ) || get_bloginfo( 'url' ) !== $token->iss ) {
591-
$token = new \WP_Error( 'invalid-jwt', __( 'The iss do not match with this server', 'wp-graphql-jwt-authentication' ) );
591+
return new \WP_Error( 'invalid-jwt', __( 'The iss do not match with this server', 'wp-graphql-jwt-authentication' ) );
592592
}
593593

594-
595594
/**
596595
* So far so good, validate the user id in the token
597596
*/
598597
if ( ! isset( $token->data->user->id ) ) {
599-
$token = new \WP_Error( 'invalid-jwt', __( 'User ID not found in the token', 'wp-graphql-jwt-authentication' ) );
598+
return new \WP_Error( 'invalid-jwt', __( 'User ID not found in the token', 'wp-graphql-jwt-authentication' ) );
600599
}
601600

602601
/**
@@ -605,7 +604,7 @@ public static function validate_token( $token = null, $refresh = false ) {
605604
if ( isset( $token->data->user->user_secret ) ) {
606605

607606
if ( Auth::is_jwt_secret_revoked( $token->data->user->id ) ) {
608-
$token = new \WP_Error( 'invalid-jwt', __( 'The User Secret does not match or has been revoked for this user', 'wp-graphql-jwt-authentication' ) );
607+
return new \WP_Error( 'invalid-jwt', __( 'The User Secret does not match or has been revoked for this user', 'wp-graphql-jwt-authentication' ) );
609608
}
610609
}
611610

0 commit comments

Comments
 (0)