app.use('/user',authentication.authenticateToken,userRoutes)
this is how my https request works.
first it goes to the middleware named authentication.authenticateToken and once access token is verified it calls next() and gose to the useRoutes and completes the desired job.
Now I want to do the same thing for socket.io requets
How can I authenticate users when he sends message and how can I use the middleware ?