hashed-psw #14
2
auth.py
2
auth.py
|
@ -6,6 +6,7 @@ PWDB_PATH = 'pwdb.json'
|
||||||
|
|
||||||
def get_credentials():
|
def get_credentials():
|
||||||
username = input('Enter your username: ')
|
username = input('Enter your username: ')
|
||||||
|
password = hash_psw(getpass('Enter your password: '))
|
||||||
password = getpass('Enter your password: ')
|
password = getpass('Enter your password: ')
|
||||||
return (username, password)
|
return (username, password)
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ def authenticate(username, password, pwdb):
|
||||||
return password == pwdb[username]
|
return password == pwdb[username]
|
||||||
|
|
||||||
def add_user(username, pwdb):
|
def add_user(username, pwdb):
|
||||||
|
pwdb[username] = hash_psw(input(f'Enter password for {username}: '))
|
||||||
pwdb[username] = input(f'Enter password for {username}: ')
|
pwdb[username] = input(f'Enter password for {username}: ')
|
||||||
return pwdb
|
return pwdb
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue