Socket.io & Strapi verify JWT

Hello to all,

I had to implement socket.io in my strapi API, but I need to check if the JWT token I pass as parameter is still valid.

I get this token with /auth/local request

How can I do ?

Example:

io.on('connection', function (socket) {
     if (isValidToken(socket.handshake.query.token)){
          //..
     }
}

isValideToken(token) {
     ...
}