File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,10 @@ pub async fn run_auth(reset: bool, auth_provider: &str) -> Result<()> {
133133 ) ;
134134 println ! ( " {}\n " , auth_url. as_str( ) . underlined( ) . cyan( ) ) ;
135135
136+ let mut browser_failed = false ;
137+
136138 if webbrowser:: open ( & auth_url) . is_err ( ) {
139+ browser_failed = true ;
137140 println ! (
138141 " {} Could not open browser automatically — please copy the link above." ,
139142 "!" . yellow( ) . bold( )
@@ -156,15 +159,24 @@ pub async fn run_auth(reset: bool, auth_provider: &str) -> Result<()> {
156159 save_config ( & config) ?;
157160
158161 let config_path = get_config_path ( ) ?. display ( ) . to_string ( ) ;
159- println ! (
160- " {} Authentication initiated! CLI ID saved to {}" ,
161- "✓" . green( ) . bold( ) ,
162- config_path. underlined( )
163- ) ;
164- println ! (
165- " {} You can now use commands that require authentication.\n " ,
166- "●" . cyan( )
167- ) ;
162+
163+ if !browser_failed {
164+ println ! (
165+ " {} Authentication initiated! CLI ID saved to {}" ,
166+ "✓" . green( ) . bold( ) ,
167+ config_path. underlined( )
168+ ) ;
169+
170+ println ! (
171+ " {} You can now use commands that require authentication.\n " ,
172+ "●" . cyan( )
173+ ) ;
174+ } else {
175+ println ! (
176+ "{} You need to open the browser URL above to complete the authentication. After that, you can use the CLI as normal." ,
177+ "?" . yellow( ) . bold( ) ,
178+ ) ;
179+ }
168180
169181 Ok ( ( ) )
170182}
You can’t perform that action at this time.
0 commit comments