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

@ -45,13 +45,13 @@ export function proxy(
})
}
export function wsProxy(
export async function wsProxy(
req: pluginapi.WebsocketRequest,
opts?: {
passthroughPath?: boolean
},
): void {
ensureAuthenticated(req)
): Promise<void> {
await ensureAuthenticated(req)
_proxy.ws(req, req.ws, req.head, {
ignorePath: true,
target: getProxyTarget(req, opts?.passthroughPath),