aboutsummaryrefslogtreecommitdiff
path: root/api/events.py
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-28 12:19:28 +0200
committerlonkaars <l.leblansch@gmail.com>2021-03-28 12:19:28 +0200
commit2f4536d6b08b69168ebf3e718cbd8e3002b9af5a (patch)
tree5307692fb341d7f924ee9b73f3751e7e56cfb192 /api/events.py
parent1f897d3f5ad11178cf4776ae4070c9d3e832f5f3 (diff)
added comments
Diffstat (limited to 'api/events.py')
-rw-r--r--api/events.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/events.py b/api/events.py
index c811be4..ef3ae12 100644
--- a/api/events.py
+++ b/api/events.py
@@ -7,6 +7,7 @@ from http import cookies
from game.cleanup import set_interval
import time
+# get token from flask_socketio's request.environment
def get_token(environ):
cookie = environ.get("HTTP_COOKIE")
if not cookie: return None
@@ -19,6 +20,7 @@ def get_token(environ):
return token.value
+# global socket connection
@io.on("connect")
def connect():
token = get_token(request.environ)