gql-fix
This commit is contained in:
parent
88f8f951ca
commit
354bc54cad
|
@ -75,7 +75,7 @@ pub async fn get_id_by_token(token: &str) -> Result<i32, Box<dyn Error>> {
|
||||||
variables.insert("token_type".to_string(), "access_token".to_string());
|
variables.insert("token_type".to_string(), "access_token".to_string());
|
||||||
|
|
||||||
let gql = json!({
|
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,
|
"operationName": operation,
|
||||||
"variables": variables
|
"variables": variables
|
||||||
});
|
});
|
||||||
|
@ -90,7 +90,7 @@ pub async fn get_id_by_token(token: &str) -> Result<i32, Box<dyn Error>> {
|
||||||
|
|
||||||
let response_text = response.text().await?;
|
let response_text = response.text().await?;
|
||||||
println!("Server Response: {}", response_text);
|
println!("Server Response: {}", response_text);
|
||||||
/*
|
|
||||||
if response.status().is_success() {
|
if response.status().is_success() {
|
||||||
let r: HashMap<String, serde_json::Value> = response.json().await?;
|
let r: HashMap<String, serde_json::Value> = response.json().await?;
|
||||||
let user_id = r
|
let user_id = r
|
||||||
|
@ -120,7 +120,7 @@ pub async fn get_id_by_token(token: &str) -> Result<i32, Box<dyn Error>> {
|
||||||
format!("Request failed with status: {}", response.status()),
|
format!("Request failed with status: {}", response.status()),
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
Err(Box::new(std::io::Error::new(
|
Err(Box::new(std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
"No user ID found in the response",
|
"No user ID found in the response",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user