feat: add logging for admin frontend client signin

This commit is contained in:
Zack Fu Zi Xiang 2024-12-09 21:13:57 +08:00
parent 02f5d2dc64
commit aa1285c59c
No known key found for this signature in database
1 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,7 @@ impl AdminFrontendClient {
.send()
.await
.unwrap();
let resp = check_resp(resp).await;
let c = resp.cookies().find(|c| c.name() == "session_id").unwrap();
self.session_id = Some(c.value().to_string());
}
@ -84,3 +85,12 @@ impl AdminFrontendClient {
self.session_id.as_ref().unwrap()
}
}
async fn check_resp(resp: reqwest::Response) -> reqwest::Response {
if resp.status() != 200 {
println!("resp: {:#?}", resp);
let payload = resp.text().await.unwrap();
panic!("payload: {:#?}", payload)
}
resp
}