SocketCluster / socketcluster-server

Minimal server module for SocketCluster
http://socketcluster.io/
MIT License
108 stars 50 forks source link

Support req.socket.setAuthToken in MIDDLEWARE_HANDSHAKE_SC #39

Closed adnanalawiyat closed 4 years ago

adnanalawiyat commented 4 years ago

Handshake http request might already have necessary credentials to establish authentication, such as Authorization header. In this case, it might be desirable to call req.socket.setAuthToken within MIDDLEWARE_HANDSHAKE_SC even if

handshake event doesn't have authToken from client.

This submission ensures handshake socket response contains isAuthenticated=true for the above use case

adnanalawiyat commented 4 years ago

hi @jondubois. will you publish a new version soon that contains this PR commit ?

jondubois commented 4 years ago

@adnanalawiyat Done.