fixed the password visibility problem

This commit is contained in:
Victoria Shevchenko 2025-09-22 15:15:42 +03:00
parent 0aadaff89d
commit 7548a83412

View file

@ -1,16 +1,17 @@
import getpass
import json
import sys
def get_credentials():
username = input('Enter your username: ')
password = input('Enter your password: ')
password = getpass.getpass('Enter your password: ')
return (username, password)
def authenticate(username, password, pwdb):
return password == pwdb[username]
def add_user(username, pwdb):
pwdb[username] = input(f'Enter password for {username}: ')
pwdb[username] = getpass.getpass(f'Enter password for {username}: ')
return pwdb
def read_pwdb(pwdb_path):