refactor: make ensureAuthenticated async

This commit is contained in:
Joe Previte
2021-06-02 13:27:55 -07:00
parent 0cdbd33b46
commit 91303d4e40
4 changed files with 8 additions and 8 deletions

View File

@@ -74,14 +74,14 @@ router.all("*", async (req, res, next) => {
export const wsRouter = WsRouter()
wsRouter.ws("*", (req, _, next) => {
wsRouter.ws("*", async (req, _, next) => {
const port = maybeProxy(req)
if (!port) {
return next()
}
// Must be authenticated to use the proxy.
ensureAuthenticated(req)
await ensureAuthenticated(req)
proxy.ws(req, req.ws, req.head, {
ignorePath: true,