diff --git a/class-auth.php b/class-auth.php index a6c4d71..62dcad1 100644 --- a/class-auth.php +++ b/class-auth.php @@ -238,7 +238,8 @@ public function get_token( WP_REST_Request $request ) { $this->send_refresh_token( $user, $request ); } - return $response; + // Let the user modify the data before send it back. + return apply_filters( 'jwt_auth_valid_credential_response', $response, $user ); } /** @@ -280,7 +281,7 @@ public function generate_token( $user, $return_raw = true ) { } // The token is signed, now create object with basic info of the user. - $response = array( + return array( 'success' => true, 'statusCode' => 200, 'code' => 'jwt_auth_valid_credential', @@ -295,9 +296,6 @@ public function generate_token( $user, $return_raw = true ) { 'displayName' => $user->display_name, ), ); - - // Let the user modify the data before send it back. - return apply_filters( 'jwt_auth_valid_credential_response', $response, $user ); } /**