Skip to content
Snippets Groups Projects
Commit f637edb6 authored by John Hodge's avatar John Hodge
Browse files

Fix another place where logout isn't done

parent 612326d1
Branches
No related merge requests found
......@@ -88,8 +88,10 @@ class OpenDispense(DispenseInterface):
sockf.write("AUTHCARD %s\n" % (card_base64,)); sockf.flush()
rsp = sockf.readline()
if not "200" in rsp:
logging.info("Rejected card base64:%s" % (card_base64,))
return False
username = rsp.split('=')[1].strip()
logging.info("Accepted card base64:%s for %s" % (card_base64,username,))
# Check for thier username
try:
......
......@@ -336,12 +336,14 @@ class VendServer():
self.vstatus.last_timeout_refresh = int(time_left)
self.vstatus.cur_selection = ''
# Login timed out: Log out the current user.
if self.vstatus.time_to_autologout != None and self.vstatus.time_to_autologout - time() <= 0:
self.vstatus.time_to_autologout = None
self.vstatus.cur_user = ''
self.vstatus.cur_pin = ''
self.vstatus.cur_selection = ''
self._last_card_id = -1
self.dispense.logOut()
self.reset_idler()
### State fully logged out ... reset variables
......@@ -382,6 +384,7 @@ class VendServer():
if key == 11:
self.vstatus.cur_selection = ''
self.vstatus.time_to_autologout = None
self.dispense.logOut()
self.scroll_options(self.vstatus.username, self.vstatus.mk)
return
else:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment