1
0
mirror of synced 2024-11-27 23:50:47 +01:00

Fix pin checking logic for frontend.

This commit is contained in:
Jennifer Taylor 2021-08-12 18:59:43 +00:00
parent 5708a2a785
commit 98b836b96e

View File

@ -228,9 +228,9 @@ def valid_username(username: str) -> bool:
def valid_pin(pin: str, type: str) -> bool:
if type == 'card':
return re.match(r"\d\d\d\d", pin) is not None
return re.match(r"^\d\d\d\d$", pin) is not None
elif type == 'arcade':
return re.match(r"\d\d\d\d\d\d\d\d", pin) is not None
return re.match(r"^\d\d\d\d\d\d\d\d$", pin) is not None
else:
return False