File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from .commands .deploy import deploy
44from .commands .env import env_app
55from .commands .login import login
6+ from .commands .logout import logout
67from .commands .whoami import whoami
78
89app = typer .Typer (rich_markup_mode = "rich" )
1314# Additional commands
1415app .command ()(deploy )
1516app .command ()(login )
17+ app .command ()(logout )
1618app .command ()(whoami )
1719
1820app .add_typer (env_app , name = "env" )
Original file line number Diff line number Diff line change 1+ from src .fastapi_cloud_cli .utils .auth import delete_auth_config
2+ from src .fastapi_cloud_cli .utils .cli import get_rich_toolkit
3+
4+
5+ def logout () -> None :
6+ """
7+ Logout from FastAPI Cloud. 🚀
8+ """
9+ with get_rich_toolkit (minimal = True ) as toolkit :
10+ delete_auth_config ()
11+
12+ toolkit .print ("You are now logged out! 🚀" )
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ def write_auth_config(auth_data: AuthConfig) -> None:
1515 auth_path .write_text (auth_data .model_dump_json (), encoding = "utf-8" )
1616
1717
18+ def delete_auth_config () -> None :
19+ auth_path = get_auth_path ()
20+
21+ if auth_path .exists ():
22+ auth_path .unlink ()
23+
24+
1825def read_auth_config () -> Optional [AuthConfig ]:
1926 auth_path = get_auth_path ()
2027
You can’t perform that action at this time.
0 commit comments