diff --git a/src/bentoml_cli/auth_server.py b/src/bentoml_cli/auth_server.py index 3f43db163ca..0058633f9a8 100644 --- a/src/bentoml_cli/auth_server.py +++ b/src/bentoml_cli/auth_server.py @@ -86,5 +86,6 @@ def wait_indefinitely_for_code(self) -> Optional[str]: """ Wait indefinitely for ther server to callback from token provider. """ - self.handle_request() + while self._code is None: + self.handle_request() return self.get_code() diff --git a/src/bentoml_cli/cloud.py b/src/bentoml_cli/cloud.py index bdff3691081..4d6f8d54237 100644 --- a/src/bentoml_cli/cloud.py +++ b/src/bentoml_cli/cloud.py @@ -73,6 +73,7 @@ def login(shared_options: SharedOptions, endpoint: str, api_token: str) -> None: reserve_free_port(enable_so_reuseport=True) ) callback_server = AuthCallbackHttpServer(port) + endpoint = endpoint.rstrip("/") baseURL = f"{endpoint}/api_tokens" encodedCallback = urllib.parse.quote(callback_server.callback_url) authURL = f"{baseURL}?callback={encodedCallback}" @@ -122,9 +123,9 @@ def login(shared_options: SharedOptions, endpoint: str, api_token: str) -> None: rich.print( f"✅ Configured BentoCloud credentials (current-context: {ctx.name})" ) - email = click.style(user.email, fg="green") - org_name = click.style(org.name, fg="green") - rich.print(f"✅ Logged in as {email} at {org_name} organization") + rich.print( + f"✅ Logged in as [blue]{user.email}[/] at [blue]{org.name}[/] organization" + ) except CloudRESTApiClientError as e: if e.error_code == 401: rich.print(