Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate example: the client ws connection is not terminated on logout? #1653

Closed
1 task done
AoDev opened this issue Oct 19, 2019 · 2 comments
Closed
1 task done

Comments

@AoDev
Copy link

AoDev commented Oct 19, 2019

  • I've searched for any related issues and avoided creating a duplicate
    issue.

Description

I have been playing with the example express-session-parse to get familiar with ws.

In the demo, when logging out the user, it is still possible for him to send and receive messages from ws. Is this on purpose for the demo or just forgotten?
I would expect the user to be completely cut from any interaction with the websocket server.

Steps to reproduce:

  • run the example, login, send message, logout, still can send message.

Expected result:

  • It's not really a bug but the example is a bit confusing for a newcomer, so I guess I'd like the example to be clearer. Should one close the client connection or do something else?

Attachments:

After logout, I can still communicate with the server.

Screen Shot 2019-10-19 at 13 56 35

@lpinca
Copy link
Member

lpinca commented Oct 19, 2019

Yes, "Simulate logout" only destroy the HTTP session. The WebSocket connection is persistent so the client is authenticated until disconnected.

I will update the example so that the WebSocket connection is closed on logout.

@lpinca lpinca closed this as completed in a6c4238 Oct 19, 2019
@AoDev
Copy link
Author

AoDev commented Oct 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants