Authenticate /pages/api route
Hi, i am trying to protect my websocket connections by verifying if the user/client is logged in or not.
Usually i'd use the getCurrentUser function:
within my socket.ts file, but this doesnt work because i receive a NextApiRequest as req and not a NextRequest.
Im having trouble finding good documentation for complete noobs to follow, only little snippets where i dont really know what is meant.
So if somebody could help me out i'd really appreciate it.
1 Reply
This is my api route where i want to authenticate my clients:
/pages/api/socket.ts