1
0
Fork 0
forked from s3lph/matemat

fix: keep buypid when wrong touchkey is entered

This commit is contained in:
s3lph 2024-12-07 22:15:48 +01:00
parent 8879add39b
commit e9b05fa4f4
Signed by untrusted user: s3lph
GPG key ID: 0AA29A52FB33CFB5

View file

@ -45,7 +45,10 @@ def touchkey_page():
user: User = db.login(str(request.params.username), touchkey=str(request.params.touchkey)) user: User = db.login(str(request.params.username), touchkey=str(request.params.touchkey))
except AuthenticationError: except AuthenticationError:
# Reload the touchkey login page on failure # Reload the touchkey login page on failure
redirect(f'/touchkey?uid={str(request.params.uid)}&username={str(request.params.username)}') url = f'/touchkey?uid={str(request.params.uid)}&username={str(request.params.username)}'
if request.params.buypid:
url += f'&buypid={request.params.buypid}'
redirect(url)
# Set the user ID session variable # Set the user ID session variable
session.put(session_id, 'authenticated_user', user.id) session.put(session_id, 'authenticated_user', user.id)
# Set the authlevel session variable (0 = none, 1 = touchkey, 2 = password login) # Set the authlevel session variable (0 = none, 1 = touchkey, 2 = password login)