Token handling

This commit is contained in:
Lynn Ochs 2022-12-03 12:10:14 +01:00
parent ac5acdf46d
commit 000b481745

View File

@ -20,7 +20,6 @@ class DoorControlNfc(util.Loggable):
self._cond = Condition(self._mutex)
self._fifo = None
self._mqttc = mqtt_client
self._read_valid_tokens()
self.last_invalid_token = mqtt.Value(self._mqttc,
"door/token/last_invalid", persistent=True)
@ -37,7 +36,7 @@ class DoorControlNfc(util.Loggable):
self._logger().info("Loading tokens")
lines =[ s.strip() for s in open(self._config.valid_tokens, "r").readlines() ]
for i, line in enumerate(lines):
l = line.split('|')
l = [s.strip() for s in line.split('|')]
if len(l) == 6:
if not l[0].strip().startswith('#'):
token, name, organization, email, valid_thru, paid = l