I have implemented a REST project with httpOnly cookie token authentication to prevent XSS attacks.
I've added chat system by socket.io, wondering how can I secure it upon XSS attacks.
As you know in XSS attack, hacker steals user's token and pretends to be him/her.
In socket.io, the client has access to the auth, how can we protect it from the attacker?
const socket = io({
auth: {
token: "abc"
}
});