prevent leaking usernames, resolves #3 #5

Open
adriama wants to merge 2 commits from adriama/2024-heraklion-git:leaking_usernames_3 into main
Showing only changes of commit 6b0ed684df - Show all commits

View file

@ -38,11 +38,8 @@ if __name__ == "__main__":
write_pwdb(pwdb, PWDB_PATH)
else:
username, password = get_credentials()
if username not in pwdb:
print('Wrong username!')
if username not in pwdb or not authenticate(username, password, pwdb):
print('Wrong credentials (username or password)!')
else:
if authenticate(username, password, pwdb):
print('Successfully authenticated!')
else:
print('Wrong password!')