Reputation: 11
I'm working on a node.js + socket.io project and I wanted to know how I could prevent my users to identify themselves several times with the same login.
In fact, I want to disconnect a user who is already connected if this user attempts to sign in with the same account.
Do you have an idea ?
Upvotes: 0
Views: 832
Reputation: 2051
When a user connected, force him/ her to fulfill some authentication, so each of your socket
connection has an identifier. With that identifier, you can search is there any user logged in with same identity? If yes, force to disconnect.
Upvotes: 1