From 1a2178959d94232e96346a64785e8d8a639ab2b1 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 27 Nov 2022 16:29:30 -0600 Subject: tell the user what email they're using in auth --- azalea-auth/src/auth.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index dbdf3f0f..bed15d74 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -76,7 +76,7 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result let mut msa = if let Some(account) = cached_account { account.msa } else { - interactive_get_ms_auth_token(&client).await? + interactive_get_ms_auth_token(&client, email).await? }; if msa.is_expired() { log::trace!("refreshing Microsoft auth token"); @@ -230,6 +230,7 @@ pub enum GetMicrosoftAuthTokenError { /// Asks the user to go to a webpage and log in with Microsoft. async fn interactive_get_ms_auth_token( client: &reqwest::Client, + email: &str, ) -> Result, GetMicrosoftAuthTokenError> { let res = client .post("https://login.live.com/oauth20_connect.srf") @@ -244,8 +245,8 @@ async fn interactive_get_ms_auth_token( .await?; log::trace!("Device code response: {:?}", res); println!( - "Go to \x1b[1m{}\x1b[m and enter the code \x1b[1m{}\x1b[m", - res.verification_uri, res.user_code + "Go to \x1b[1m{}\x1b[m and enter the code \x1b[1m{}\x1b[m for \x1b[1m{}\x1b[m", + res.verification_uri, res.user_code, email ); let login_expires_at = Instant::now() + std::time::Duration::from_secs(res.expires_in); -- cgit v1.2.3