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_st
04/25/2023, 9:10 AM
hey @whatsappxthomas
rp_st
04/25/2023, 9:13 AM
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
whatsappxthomas
04/25/2023, 9:24 AM
OK thanks
TBH, I am a bit disappointed there is no solution outside the JWT one!
r
rp_st
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
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).