empty == return
This commit is contained in:
parent
2b90572f1e
commit
65b1e8e0a2
@ -11,8 +11,13 @@ class User:
|
||||
self.password = password
|
||||
|
||||
def login(self):
|
||||
print("Keep input empty to return")
|
||||
input_username = input("Username: ")
|
||||
if input_username == "":
|
||||
return False
|
||||
input_password = getpass("Password: ")
|
||||
if input_password == "":
|
||||
return False
|
||||
|
||||
hashed_password = UtilityHelper.computeHash(input_password)
|
||||
|
||||
@ -27,8 +32,13 @@ class User:
|
||||
return False
|
||||
|
||||
def register(self):
|
||||
print("Keep input empty to return")
|
||||
input_username = input("Username: ")
|
||||
if input_username == "":
|
||||
return False
|
||||
input_password = getpass("Password: ")
|
||||
if input_password == "":
|
||||
return False
|
||||
|
||||
if len(input_username) < 4 or len(input_password) < 4:
|
||||
print(f"{UtilityHelper.errorMessage('Username or password is too short, inputs should be atleast 4 characters long')}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user