You've already forked pages
forked from didirus/AstralRinth
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user