when logging with a new user, the second match clause Err(AppError::UserNotFound) should hit
but the first match clause is hitting (which is wild)
I checked my database (mongodb) over and over again there is no such entry of the email that I was using
and after hitting the first clause it is neither printing the User (u variable) and the cookies variable
it is a very odd behavior that rust skip statements like that, I have never seen that before
then it is hitting this statement ActiveSession::parse_and_verify(&cookies)
pub fn parse_and_verify(cookies_list: &Vec<String>) -> Result<Self, AppError> {
if cookies_list.is_empty() {
return Err(AppError::Unauthorized("No cookie header found"));
}
let mut parsed_active_session = None;
for cookies in cookies_list {
if let Some(s) = cookies.split(';').find(|s| s.trim().starts_with("SSID=")) {
parsed_active_session = Some(Self {
ssid: s.trim()[5..].to_string(),
decrypted_ssid: "".to_string(),
});
break;
}
}
if let Some(mut active_session) = parsed_active_session {
if let Some(s) = super::verify(&active_session.ssid) {
active_session.decrypted_ssid = s;
Ok(active_session)
} else {
Err(AppError::InvalidSession(active_session.expire()))
}
} else {
Err(AppError::Unauthorized("Invalid Session"))
}
}
and directly returning this error Err(AppError::Unauthorized("No cookie header found"))
hitting that match clause should return a Redirect response from the inner match statement
the callback route is of around ~150 lines, is that the problem?