Changeset View
Changeset View
Standalone View
Standalone View
keyserver/addons/rust-node-addon/src/identity_client/login_user.rs
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | ) -> Result<String> { | ||||
send_to_mpsc(tx.clone(), login_request).await?; | send_to_mpsc(tx.clone(), login_request).await?; | ||||
// Handle responses from Identity service sequentially, making sure we get | // Handle responses from Identity service sequentially, making sure we get | ||||
// messages in the correct order | // messages in the correct order | ||||
// Finish PAKE login; send final login request to Identity service | // Finish PAKE login; send final login request to Identity service | ||||
let message = response.message().await.map_err(|e| { | let message = response.message().await.map_err(|e| { | ||||
error!("Received an error from inbound message stream: {}", e); | error!("Received an error from inbound message stream: {}", e); | ||||
Error::from_status(Status::GenericFailure) | match e.code() { | ||||
Code::NotFound => { | |||||
Error::new(Status::InvalidArg, "user not found".to_string()) | |||||
} | |||||
_ => Error::new(Status::GenericFailure, e.to_string()), | |||||
} | |||||
})?; | })?; | ||||
handle_login_credential_response( | handle_login_credential_response( | ||||
message, | message, | ||||
client_login_start_result.state, | client_login_start_result.state, | ||||
tx, | tx, | ||||
) | ) | ||||
.await?; | .await?; | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |