small bug fix with sockets and auth

This commit is contained in:
Zoe
2023-04-24 20:38:18 -05:00
parent 1c66cb3512
commit 54cd5b8654
3 changed files with 39 additions and 3 deletions

View File

@@ -12,6 +12,8 @@ export default defineEventHandler(({ node }) => {
global.io.on('connection', async (socket: Socket) => {
const token = socket.handshake.auth.token;
console.log(token);
if (!token) {
socket.disconnect();
return;