diff --git a/src/data.rs b/src/data.rs index 8bd59c9..37b52a9 100644 --- a/src/data.rs +++ b/src/data.rs @@ -75,7 +75,7 @@ pub async fn get_id_by_token(token: &str) -> Result> { variables.insert("token_type".to_string(), "access_token".to_string()); let gql = json!({ - "query": format!("query {}($params: ValidateJWTTokenInput) {{ {}(params: $params) {{ is_valid claims }} }}", operation, query_name), + "query": format!("query {}($params: ValidateJWTTokenInput!) {{ {}(params: $params) {{ is_valid claims }} }}", operation, query_name), "operationName": operation, "variables": variables }); @@ -90,7 +90,7 @@ pub async fn get_id_by_token(token: &str) -> Result> { let response_text = response.text().await?; println!("Server Response: {}", response_text); - /* + if response.status().is_success() { let r: HashMap = response.json().await?; let user_id = r @@ -120,7 +120,7 @@ pub async fn get_id_by_token(token: &str) -> Result> { format!("Request failed with status: {}", response.status()), ))) } - */ + Err(Box::new(std::io::Error::new( std::io::ErrorKind::Other, "No user ID found in the response",