cli: fix text shown when GH auth is auto-selected (#196527)

Refs https://github.com/microsoft/vscode-remote-release/issues/8908\#issuecomment-1778427807
This commit is contained in:
Connor Peet 2023-10-25 00:07:14 -07:00 committed by GitHub
parent 2542c28019
commit fcb814b0d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
use crate::{
constants::{get_default_user_agent, IS_INTERACTIVE_CLI, PRODUCT_NAME_LONG},
constants::{get_default_user_agent, APPLICATION_NAME, IS_INTERACTIVE_CLI, PRODUCT_NAME_LONG},
debug, error, info, log,
state::{LauncherPaths, PersistedState},
trace,
@ -84,7 +84,9 @@ impl AuthProvider {
pub fn grant_uri(&self) -> &'static str {
match self {
AuthProvider::Microsoft => "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
AuthProvider::Microsoft => {
"https://login.microsoftonline.com/organizations/oauth2/v2.0/token"
}
AuthProvider::Github => "https://github.com/login/oauth/access_token",
}
}
@ -673,7 +675,8 @@ impl Auth {
if !*IS_INTERACTIVE_CLI {
info!(
self.log,
"Using Github for authentication, pass the `--provider` option to change this."
"Using Github for authentication, run `{} tunnel user login --provider <provider>` option to change this.",
APPLICATION_NAME
);
return Ok(AuthProvider::Github);
}