Closed zalky closed 11 months ago
@zalky Hi there, apologies for the very long delay replying!
To answer your questions:
[:chsk/close]
is appropriate for this case, and will continue to be supported. It'll become officially documented in a future release.
Hi, thanks for putting together this fantastic library! I've really loved working with sente so far and it has been a boon for development.
I have a working implementation that deals with user login/authentication/authorization/logout. Everything works, but I'd like to validate the method I used for dealing with active sente connections after the user session has been expired.
As best I can tell, the session data available to the sente event handler is that of the original request that initiated the handshake. All future sente events will see this original request with its corresponding session data, even if the user session has since changed or been expired.
I've placed some middleware on the sente event handler that checks the session store for the up-to-date session information and drops the request if the session has expired (optionally triggering some workflow client-side for logout/login, but that is beyond the scope of the question). I would ideally like to close the connection, rather than just drop the request, but the only guaranteed way I know to close the connection is the
[:chsk/close]
event, which is not part of the official api, and is subject to change.So:
[:chsk/close]
the only guaranteed way to close the connection server side?