Augments Koa with const { name, pass } = ctx.basicAuth
and ctx.request.basicAuth
.
const Koa = require('koa')
const app = new Koa()
require('koa-ctx-basic-auth')(app)
app.use(async (ctx, next) => {
const { name, pass } = ctx.basicAuth
// OR
const { name, pass } = ctx.request.basicAuth
await next()
})