Merge pull request #13 from TargetedEntropy/auth_fix

updated example for presistence
This commit is contained in:
TargetedEntropy 2023-03-28 11:03:16 -04:00 committed by GitHub
commit 2b594ad996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -86,3 +86,4 @@ sftp-config.json
### pyCraft ###
credentials
Persistence/*

View File

@ -135,7 +135,13 @@ def main():
try:
auth_token = authentication.Microsoft_AuthenticationToken()
auth_token.authenticate()
if options.username:
if not auth_token.PersistenceLogoin_r(options.username):
print("Login to {} failed".format(options.username))
sys.exit(1)
else:
if not auth_token.authenticate():
sys.exit(2)
except YggdrasilError as e:
print(e)
sys.exit()