File tree Expand file tree Collapse file tree
src/fastapi_cloud_cli/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,17 @@ def login() -> Any:
9393
9494 return
9595
96+ if identity .deploy_token is not None :
97+ with get_rich_toolkit () as toolkit :
98+ toolkit .print (
99+ (
100+ "You have [bold blue]FASTAPI_CLOUD_TOKEN[/] environment variable set.\n "
101+ + "This token will take precedence over the user token for "
102+ + "[blue]`fastapi deploy`[/] command."
103+ ),
104+ tag = "Warning" ,
105+ )
106+
96107 with get_rich_toolkit () as toolkit , APIClient () as client :
97108 toolkit .print_title ("Login to FastAPI Cloud" , tag = "FastAPI" )
98109
Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ def test_full_login_with_deploy_token_set(
116116 assert result .exit_code == 0
117117 assert mock_open .called
118118 assert mock_open .call_args .args == ("http://test.com" ,)
119+
120+ # Verify the warning message is shown
121+ assert "You have FASTAPI_CLOUD_TOKEN environment variable set." in result .output
122+ assert "This token will take precedence over the user token" in result .output
123+
119124 assert "Now you are logged in!" in result .output
120125
121126 # Verify auth file was created with correct content
You can’t perform that action at this time.
0 commit comments