Derrick W
KKinde
•Created by Derrick W on 11/13/2024 in #💻┃support
websockets
My solution is using nuxt3 and Nuxt's embedded h3 server with crossws. My goal for my application is to minimize the number of connections to the server and given our application, we would need quite a few. Using a single websocket resolves that issue.
So upon a user's authentication with the server (and ultimately with Kinde), I'm having the browser create a websocket connection to h3 and in code using the defineWebSocketHandler() routine. During the open event, the server receives the peer connection from the browser. It's easy enough to pass any parameter via the WSS query string or headers. I was hoping to validate the user's identity on the server-side using the WSS's initial request object and cookies.
Is there a prescribed method for doing this? If I have the 'Kinde' cookie, can I use that to validate and identify the user?
For defineEventHandler() the event's context has a reference to kinde, isAuthenticated, etc. The peer object handled within defineWebSocketHandler() doesn't seem to have a context or ctx with related validation routines.
Just wondering if there's a manual way to handle the kinde cookie?
1 replies