Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update print and fix cors error #4829

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bentoml_cli/auth_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
7 changes: 4 additions & 3 deletions src/bentoml_cli/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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(
Expand Down
Loading