diff --git a/realtime/middlewares/authenticate.js b/realtime/middlewares/authenticate.js index 022ba1f597..3e521e52d2 100644 --- a/realtime/middlewares/authenticate.js +++ b/realtime/middlewares/authenticate.js @@ -16,8 +16,12 @@ function authenticate_with_frappe(socket, next) { return; } - if (!socket.request.headers.cookie) { - next(new Error("No cookie transmitted.")); + if (!socket.request.headers.cookie && !socket.request.headers.authorization) { + next( + new Error( + "Missing cookie and authorization header. Either one needed for authentication." + ) + ); return; }