arena icon indicating copy to clipboard operation
arena copied to clipboard

Allow arena to work as a node module alongside auth middleware.

Open aaron-blondeau-dose opened this issue 7 years ago • 4 comments

I have been unable to find a way to add arena to an existing express app while also implementing authentication. The basePath parameter conflicts with any path other than "/" provided to express' use method. Allowing users to provide a new parameter called "mountPath" can alleviate this issue and allow configs like the following to work:

const arena = Arena({
    queues
}, {
    basePath: '/admin/',
    mountPath: '/',
    disableListen: true
})

app.use('/admin', basicAuth('foo', 'bar'), arena)

where basicAuth = https://github.com/expressjs/basic-auth-connect

aaron-blondeau-dose avatar Sep 26 '18 01:09 aaron-blondeau-dose

I'm looking forward to this

javorosas avatar Nov 10 '18 17:11 javorosas

Any updates on this?

dbronin avatar Apr 30 '19 01:04 dbronin

I have no idea why it is not merged yet. However, here is a workaround at the moment:

const arena = Arena({
    queues
}, {
    basePath: '/',
    disableListen: true
})

// powerhacking
arena.locals.appBasePath = "/admin"

app.use('/admin', basicAuth('foo', 'bar'), arena)

bogdan avatar Nov 18 '19 16:11 bogdan

Merging #182 into this.

skeggse avatar Aug 06 '20 18:08 skeggse