diff --git a/src/authorize.ts b/src/authorize.ts index e07616a..1a8f82a 100644 --- a/src/authorize.ts +++ b/src/authorize.ts @@ -42,6 +42,9 @@ export const authorize = (options: AuthorizeOptions): SocketIOMiddleware => { return async (socket, next) => { let encodedToken: string | null = null const { token } = socket.handshake.auth + if (token == null) { + token = socket.handshake.headers.authorization + } if (token != null) { const tokenSplitted = token.split(" ") if (tokenSplitted.length !== 2 || tokenSplitted[0] !== "Bearer") {