feat_account: mid commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-10-20 23:03:54 +08:00
parent 3454454bd5
commit 87e53501e3
8 changed files with 536 additions and 50 deletions

View File

@@ -20,8 +20,7 @@ use hbb_common::{
tokio::{self, sync::mpsc, time},
};
use crate::ipc;
use crate::{common::SOFTWARE_UPDATE_URL, platform};
use crate::{common::SOFTWARE_UPDATE_URL, hbbs_http::account, ipc, platform};
type Message = RendezvousMessage;
@@ -843,6 +842,16 @@ pub(crate) fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender<ipc
tx
}
#[tokio::main(flavor = "current_thread")]
pub async fn account_auth(op: String) {
account::OidcSession::account_auth(op, get_id(), get_uuid()).await;
}
#[tokio::main(flavor = "current_thread")]
pub async fn account_auth_result() -> String {
serde_json::to_string(&account::OidcSession::get_result().await).unwrap_or_default()
}
// notice: avoiding create ipc connecton repeatly,
// because windows named pipe has serious memory leak issue.
#[tokio::main(flavor = "current_thread")]