aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea-auth/src/auth.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs
index 5f96d4be..0cc36fcf 100644
--- a/azalea-auth/src/auth.rs
+++ b/azalea-auth/src/auth.rs
@@ -55,9 +55,15 @@ pub enum AuthError {
/// anything. You should just have it be the actual email so it's not confusing
/// though, and in case the Microsoft API does start providing the real email.
pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError> {
- let cached_account = if let Some(cache_file) = &opts.cache_file && let Some(account) = cache::get_account_in_cache(cache_file, email).await {
- Some(account)
- } else { None };
+ let cached_account = if let Some(cache_file) = &opts.cache_file {
+ if let Some(account) = cache::get_account_in_cache(cache_file, email).await {
+ Some(account)
+ } else {
+ None
+ }
+ } else {
+ None
+ };
// these two MUST be set by the end, since we return them in AuthResult
let profile: ProfileResponse;