Commit 86e30aa3 by Luciano Barletta

added a session delete

1 parent 2fb27c0c
......@@ -121,5 +121,14 @@ def ivalidate():
return aux.validate(data)
@app.route('/remove-session', methods = ['POST'])
def removesession():
try:
validation = Validation()
validation.remove_roken(request.json)
aux.answer(True)
except:
aux.answer(False, "Error borrando sesión")
if __name__ == "__main__":
app.run("0.0.0.0")
\ No newline at end of file
......@@ -35,6 +35,9 @@ QWERTYUIOPASDFGHJKLZXCVBNM\
def check_token(self,token):
return token in self.data
def remove_token(self,token)
self.data.discard(token)
def __del__(self):
with open(self.FILE, "+w") as f:
f.write(json.dumps(list(self.data)))
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!