Skip to content

Commit

Permalink
Make pantry ws auth more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleMalt committed Jul 27, 2022
1 parent b683a29 commit 8f038ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pantry/services/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ function addWebsocket(server) {
peerId === undefined ||
((roomId === undefined || !ssrVerifyToken(token, publicKey)) &&
!internal) ||
(roomInfo.access?.identities &&
!roomInfo.access?.identities.includes(publicKey))
(roomInfo?.access?.identities &&
!roomInfo.access.identities.includes(publicKey))
) {
console.log('ws rejected!', req.url, 'room', roomId, 'peer', peerId);
socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
Expand Down

0 comments on commit 8f038ff

Please sign in to comment.