File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ def decrypt_token(encrypted_token, key):
61
61
# Function to get or set token
62
62
def get_or_set_token ():
63
63
key = load_or_generate_key ()
64
+ token_file = os .path .join (caltechdata_directory , "token.txt" )
64
65
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 :
67
67
encrypted_token = f .read ()
68
68
token = decrypt_token (encrypted_token , key )
69
69
return token
@@ -73,7 +73,7 @@ def get_or_set_token():
73
73
confirm_token = input ("Confirm your CaltechDATA token: " ).strip ()
74
74
if token == confirm_token :
75
75
encrypted_token = encrypt_token (token , key )
76
- with open ("token.txt" , "wb" ) as f :
76
+ with open (token_file , "wb" ) as f :
77
77
f .write (encrypted_token )
78
78
return token
79
79
else :
You can’t perform that action at this time.
0 commit comments