Launcher Auth (#450)

* Launcher Auth

* Finish auth

* final fixes
This commit is contained in:
Geometrically
2023-08-04 23:38:34 -07:00
committed by GitHub
parent a35dd67b77
commit 47e28d24c8
38 changed files with 1200 additions and 477 deletions

View File

@@ -6,7 +6,10 @@ use tokio::task::JoinHandle;
// A wrapper over the authentication task that allows it to be called from the frontend
// without caching the task handle in the frontend
pub struct AuthTask(Option<JoinHandle<crate::Result<Credentials>>>);
pub struct AuthTask(
#[allow(clippy::type_complexity)]
Option<JoinHandle<crate::Result<(Credentials, Option<String>)>>>,
);
impl AuthTask {
pub fn new() -> AuthTask {
@@ -37,7 +40,8 @@ impl AuthTask {
Ok(url)
}
pub async fn await_auth_completion() -> crate::Result<Credentials> {
pub async fn await_auth_completion(
) -> crate::Result<(Credentials, Option<String>)> {
// Gets the task handle from the state, replacing with None
let task = {
let state = crate::State::get().await?;