https://supertokens.com/ logo
with web sockets
w

whatsappx-thomas

04/25/2023, 9:10 AM
How would a middleware work in the case of a WebSocket connection ? I can't get my head around this as the only solution I find in the doc is related to the
verifySession
which is directly related to the
express
framework ! Is there a way I can just validate the
sAccessToken
from my Cookie ?
r

rp

04/25/2023, 9:10 AM
hey @whatsappx-thomas
you can enable JWTs with sessions, and pass the JWT in your socket connection. You can then verify the JWT using any standard jwt verification lib on the backend.
w

whatsappx-thomas

04/25/2023, 9:24 AM
OK thanks TBH, I am a bit disappointed there is no solution outside the JWT one!
r

rp

04/25/2023, 10:03 AM
yea i mean.. web sockets don't use cookies etc.. So there is not much of a choice here