Skip to content

Commit 0168944

Browse files
authored
Merge pull request #932 from codeflash-ai/chore/add/apikey/Validation
[Chore] Validate API key in the init flow
2 parents ad09525 + 16a0c09 commit 0168944

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

codeflash/cli_cmds/cmd_init.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from rich.table import Table
2323
from rich.text import Text
2424

25-
from codeflash.api.cfapi import is_github_app_installed_on_repo
25+
from codeflash.api.cfapi import get_user_id, is_github_app_installed_on_repo
2626
from codeflash.cli_cmds.cli_common import apologize_and_exit
2727
from codeflash.cli_cmds.console import console, logger
2828
from codeflash.cli_cmds.extension import install_vscode_extension
@@ -1216,6 +1216,7 @@ def enter_api_key_and_save_to_rc() -> None:
12161216
# On Windows, create a batch file in the user's home directory (not auto-run, just used to store api key)
12171217
shell_rc_path.touch()
12181218
click.echo(f"✅ Created {shell_rc_path}")
1219+
get_user_id(api_key=api_key) # Used to verify whether the API key is valid.
12191220
result = save_api_key_to_rc(api_key)
12201221
if is_successful(result):
12211222
click.echo(result.unwrap())

0 commit comments

Comments
 (0)