Skip to content

Commit

Permalink
More debug logs on websockets not connecting from workers
Browse files Browse the repository at this point in the history
andresgutgon committed Sep 18, 2024
1 parent 6d46cee commit ec070ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/websockets/src/server.ts
Original file line number Diff line number Diff line change
@@ -109,12 +109,14 @@ workers.use(async (socket, next) => {
try {
const token = socket.handshake.auth?.token
if (!token) {
console.log('DEBUG: No token provided')
return next(new Error('Authentication error: No token provided'))
}

const result = await verifyWorkerWebsocketToken(token)

if (result.error) {
console.log('DEBUG: JWT verification failed for worker:', result.error)
return next(new Error(`Authentication error: ${result.error.message}`))
}

0 comments on commit ec070ac

Please sign in to comment.