Use ensureAuthenticated as middleware

This commit is contained in:
Asher
2020-11-03 16:45:03 -06:00
parent 476379a77e
commit 34225e2bdf
5 changed files with 40 additions and 34 deletions

View File

@@ -82,7 +82,7 @@ router.all("*", (req, res, next) => {
})
})
router.ws("*", (socket, head, req, next) => {
router.ws("*", (req, _, next) => {
const port = maybeProxy(req)
if (!port) {
return next()
@@ -91,7 +91,7 @@ router.ws("*", (socket, head, req, next) => {
// Must be authenticated to use the proxy.
ensureAuthenticated(req)
proxy.ws(req, socket, head, {
proxy.ws(req, req.ws, req.head, {
ignorePath: true,
target: `http://0.0.0.0:${port}${req.originalUrl}`,
})