File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments