Skip to content

Commit

Permalink
connect ws to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
IkeHunter committed Sep 5, 2024
1 parent dec70a5 commit ab9ac97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ services:
- KAFKA_BROKERS=kafka-jbx:9092
- KAFKA_GROUP_ID=websocket-jbx
- LOG_NS=websocket
- BYPASS_AUTH=1
# - BYPASS_AUTH=1
command: npm run dev:websocket
networks:
- cluster
Expand Down
1 change: 1 addition & 0 deletions websocket/middleware/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const authMiddleware = (socket: CustomSocket, next: SocketNext) => {
if (BYPASS_AUTH) return next()

const userId = socket.handshake.auth.userId

if (!userId) {
logger.warn('Client does not have valid user id.')
return next(new Error('Must include valid user id.'))
Expand Down

0 comments on commit ab9ac97

Please sign in to comment.