From 7548a834123579375d7a36ec381926594c6235bc Mon Sep 17 00:00:00 2001 From: victoris93 Date: Mon, 22 Sep 2025 15:15:42 +0300 Subject: [PATCH] fixed the password visibility problem --- minimal_auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/minimal_auth.py b/minimal_auth.py index 1950121..30fd41f 100644 --- a/minimal_auth.py +++ b/minimal_auth.py @@ -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):