Matador icon indicating copy to clipboard operation
Matador copied to clipboard

Basic auth example

Open krazyjakee opened this issue 8 years ago • 1 comments

I would like to password protect the interface. I tried to copy the http-auth and express method but it didn't work. How can I achieve this?

krazyjakee avatar Apr 11 '17 15:04 krazyjakee

Sorry, I should include the example...

const app = require('bull-ui/app')({
  redis: {
    host: process.env.REDIS_HOST,
    port: process.env.REDIS_PORT
  }
})

const auth = require('http-auth')
const basic = auth.basic({
  realm: 'SUPER SECRET STUFF'
}, (username, password, callback) => {
  callback(username == 'admin' && password == 'password');
})
app.use(auth.connect(basic))
app.listen(1337, () => {
  console.log('bull-ui started listening on port 1337');
})

krazyjakee avatar Apr 20 '17 13:04 krazyjakee