sdelements / lets-chat

Self-hosted chat app for small teams
http://sdelements.github.io/lets-chat
MIT License
9.76k stars 1.58k forks source link

When does a user connect and disconnect ? #770

Open mmeinert opened 6 years ago

mmeinert commented 6 years ago

I was asked to discover when a specific user logged in let's chat and I can't find where I may have this information ? I use LDAP for the authentication.

In MongoDB ? I can see sessions but I can't link them to users In Nginx's access log ? I find things like /socket.io/?EIO=3&transport=polling&t=1511680349141-0 and /socket.io/?EIO=3&transport=polling&t=1511791115736-3&sid=cAzuNdX-8-k8VevhAAJp but can't link those either.

So, is there a way to find out when a user came and leaved the system ?

mmeinert commented 6 years ago

I'm wondering if some external Node.js modules could be used :

Any idea on how to implement them ?

hhaidar commented 6 years ago

It's not stored anywhere, but you can probably add some code when a user connects around here: https://github.com/sdelements/lets-chat/blob/1ae835fea4db48ea1ab0166991f1268df6241a96/app/controllers/presence.js#L29