From 7268ea028a472ee058bf2b123f0503bc68537356 Mon Sep 17 00:00:00 2001 From: Romazes Date: Thu, 18 Jul 2024 20:50:39 +0300 Subject: [PATCH] feat: auto open browser when call authorize --- lean/components/api/auth0_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lean/components/api/auth0_client.py b/lean/components/api/auth0_client.py index a7be6916..ec9d0046 100644 --- a/lean/components/api/auth0_client.py +++ b/lean/components/api/auth0_client.py @@ -51,7 +51,11 @@ def authorize(brokerage_id: str, logger: Logger) -> None: :param brokerage_id: the id of the brokerage to start the authorization process for :param logger: the logger instance to use """ + from webbrowser import open full_url = f"{API_BASE_URL}live/auth0/authorize?brokerage={brokerage_id}" logger.info(f"Please open the following URL in your browser to authorize the LEAN CLI.") logger.info(full_url) + open(full_url) + +