Skip to content

Commit d93ee58

Browse files
committed
Fix token file
1 parent f9e2561 commit d93ee58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

caltechdata_api/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def decrypt_token(encrypted_token, key):
6161
# Function to get or set token
6262
def get_or_set_token():
6363
key = load_or_generate_key()
64+
token_file = os.path.join(caltechdata_directory, "token.txt")
6465
try:
65-
token = os.path.join(caltechdata_directory, "token.txt")
66-
with open(token, "rb") as f:
66+
with open(token_file, "rb") as f:
6767
encrypted_token = f.read()
6868
token = decrypt_token(encrypted_token, key)
6969
return token
@@ -73,7 +73,7 @@ def get_or_set_token():
7373
confirm_token = input("Confirm your CaltechDATA token: ").strip()
7474
if token == confirm_token:
7575
encrypted_token = encrypt_token(token, key)
76-
with open("token.txt", "wb") as f:
76+
with open(token_file, "wb") as f:
7777
f.write(encrypted_token)
7878
return token
7979
else:

0 commit comments

Comments
 (0)