Development

This commit is contained in:
Matthew Grotke 2026-06-07 23:32:06 -04:00
parent db837af548
commit 64f83d683e
8 changed files with 237 additions and 26 deletions

View file

@ -8,7 +8,7 @@ import config_utils
CREDENTIALS_DB = f'{config_utils.CONFIGS_DIR}/.client-credentials'
USER_TYPE_CAPTIVE = 0
HASH_BCRYPT = 2
DIGEST_HASH_BCRYPT = 2
bp = Blueprint('portal', __name__)
@ -82,7 +82,7 @@ def _verify_credential(username, password, vlan_name):
return False
if row['valid_for'] is not None and (row['date_set'] + row['valid_for']) < int(time.time()):
return False
if row['hash_type'] == HASH_BCRYPT:
if row['digest_type'] == DIGEST_HASH_BCRYPT:
try:
return bcrypt.checkpw(password.encode(), row['password'].encode())
except Exception: