[BE][Classroom] Log html response on login http 302
This commit is contained in:
parent
4e3f70d8e0
commit
31d7f0697c
@ -252,11 +252,21 @@ async fn login() -> Result<(), String> {
|
||||
match response {
|
||||
Ok(mut r) => {
|
||||
if r.status() == isahc::http::StatusCode::FOUND {
|
||||
// TODO: Even if this is a 302, it might not be a successful login
|
||||
let html = match r.text() {
|
||||
Ok(t) => t,
|
||||
Err(err) => {
|
||||
return Err(format!("Error getting text from login response: {:?}", err))
|
||||
}
|
||||
};
|
||||
log::info!("classroom login: 302 response.");
|
||||
log_html(&html);
|
||||
|
||||
// check Set-Cookie header
|
||||
SESSION_COOKIE.write().unwrap().jar = jar.clone();
|
||||
Ok(())
|
||||
} else {
|
||||
log::info!("classroom login: not 302");
|
||||
|
||||
// Write html to file
|
||||
match r.text() {
|
||||
Ok(t) => {
|
||||
|
Loading…
Reference in New Issue
Block a user