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