From 8fb01313189425dcc68318692b819b9882239c02 Mon Sep 17 00:00:00 2001 From: DIDIRUS4 Date: Sat, 4 Nov 2023 00:12:16 +0300 Subject: [PATCH] Fix --- theseus/src/api/auth.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/theseus/src/api/auth.rs b/theseus/src/api/auth.rs index 36c80816f..cabeaab74 100644 --- a/theseus/src/api/auth.rs +++ b/theseus/src/api/auth.rs @@ -48,39 +48,6 @@ pub async fn refresh(user: uuid::Uuid) -> crate::Result { .as_error() })?; - let offline = *state.offline.read().await; - - if !offline { - let fetch_semaphore: &crate::util::fetch::FetchSemaphore = - &state.fetch_semaphore; - if Utc::now() > credentials.expires - && inner::refresh_credentials(&mut credentials, fetch_semaphore) - .await - .is_err() - { - users.remove(credentials.id).await?; - - return Err(crate::ErrorKind::OtherError( - "Please re-authenticate with your Minecraft account!" - .to_string(), - ) - .as_error()); - } - - // Update player info from bearer token - let player_info = - hydra::stages::player_info::fetch_info(&credentials.access_token) - .await - .map_err(|_err| { - crate::ErrorKind::HydraError( - "No Minecraft account for your profile. Please try again or contact support in our Discord for help!".to_string(), - ) - })?; - - credentials.username = player_info.name; - users.insert(&credentials).await?; - } - Ok(credentials) }