encrypt/decrypt and db interaction
This commit is contained in:
@ -45,6 +45,11 @@ async fn handle(mut stream: TcpStream, app_handle: AppHandle) -> Result<(), Requ
|
||||
let (chan_send, chan_recv) = oneshot::channel();
|
||||
let app_state = app_handle.state::<crate::state::AppState>();
|
||||
let request_id = app_state.register_request(chan_send);
|
||||
|
||||
if let std::net::SocketAddr::V4(addr) = stream.peer_addr()? {
|
||||
crate::clientinfo::get_client_info(addr.port());
|
||||
}
|
||||
|
||||
// Do we want to panic if this fails? Does that mean the frontend is dead?
|
||||
app_handle.emit_all("credentials-request", Request {id: request_id}).unwrap();
|
||||
|
||||
@ -77,7 +82,7 @@ async fn handle(mut stream: TcpStream, app_handle: AppHandle) -> Result<(), Requ
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let creds = app_state.get_creds_serialized();
|
||||
let creds = app_state.get_creds_serialized()?;
|
||||
|
||||
stream.write(b"\r\nContent-Length: ").await?;
|
||||
stream.write(creds.as_bytes().len().to_string().as_bytes()).await?;
|
||||
|
Reference in New Issue
Block a user