Skip to content

Commit

Permalink
Implemented no username and password for Issue #69
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlight071 committed Feb 6, 2024
1 parent 105e53d commit 9b98382
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sudo_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def sudo_admin():
username = input("\nEnter your username: ")
password = getpass.getpass("Enter your password: ")

if not username or not password:
print(Fore.RED + "\nUsername and password are required." + Style.RESET_ALL)
time.sleep(2)
clear_screen()
continue

user = users_collection.find_one({'username': username})

if user:
Expand Down
7 changes: 7 additions & 0 deletions sudo_user_level_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ def sudo_user():
attempts = 0

clear_screen()


while attempts < MAX_ATTEMPTS:
print(Fore.LIGHTMAGENTA_EX + "\n👤 Sudo Login 👤" + Style.RESET_ALL)
print("\nPlease enter your credentials")
username = input("\nEnter your username: ")
password = getpass.getpass("Enter your password: ")

if not username or not password:
print(Fore.RED + "\nUsername and password are required." + Style.RESET_ALL)
time.sleep(2)
clear_screen()
continue

user = users_collection.find_one({'username': username})

if user:
Expand Down

0 comments on commit 9b98382

Please sign in to comment.