Box::pin authenticate function

This commit is contained in:
Maurus Decimus
2026-04-24 19:58:03 +02:00
parent 96795b0cf2
commit e73b65c5a3
9 changed files with 58 additions and 73 deletions

View File

@@ -69,7 +69,7 @@ impl<T: SessionStream> Session<T> {
match (token.mechanism, &mut token.credentials) {
(AUTH_PLAIN, _) => {
if let Some(credentials) = Credentials::decode_sasl_challenge_plain(&response) {
return Box::pin(self.authenticate(credentials)).await;
return self.authenticate(credentials).await;
}
}
(
@@ -84,20 +84,20 @@ impl<T: SessionStream> Session<T> {
Ok(true)
} else {
*secret = response.into_string();
Box::pin(self.authenticate(std::mem::replace(
self.authenticate(std::mem::replace(
&mut token.credentials,
Credentials::Basic {
username: String::new(),
secret: String::new(),
mfa_token: None,
},
)))
))
.await
};
}
(AUTH_OAUTHBEARER | AUTH_XOAUTH2, _) => {
if let Some(credentials) = Credentials::decode_sasl_challenge_oauth(&response) {
return Box::pin(self.authenticate(credentials)).await;
return self.authenticate(credentials).await;
}
}
_ => (),