Stabilize frontend login. Make chat messages multiline.
This commit is contained in:
1 parent
5bbdfe8747
commit
3f37f727af
6 files changed
+71
-31
No files matched your search
@@ -86,6 +86,10 @@ def start_server(app):
|
||||
await websocket.send(json.dumps({'error': 'invalid credentials'}))
|
||||
return
|
||||
|
||||
# TODO: print username instead, same in the finally block
|
||||
print("User logged in:", user_id)
|
||||
await websocket.send(json.dumps({'message': 'authentication successful'}))
|
||||
|
||||
send_queue = asyncio.Queue()
|
||||
async def sender_task():
|
||||
nonlocal send_queue
|
||||
@@ -190,6 +194,7 @@ def start_server(app):
|
||||
else:
|
||||
await send({'error': 'unknown action: ' + action, 'nonce': nonce})
|
||||
finally:
|
||||
print("User logged out:", user_id)
|
||||
app.remove_user_connection(user_id, send_queue)
|
||||
|
||||
server.run(debug=True)
|
||||
Reference in new issue
Block a user