Skip to content

koajs/ctx-basic-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koa Context Basic Auth

NPM version Build status Test coverage Greenkeeper badge Dependency Status License Downloads

Augments Koa with const { name, pass } = ctx.basicAuth and ctx.request.basicAuth.

Example

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()
})

About

Augments Koa with ctx.basicAuth

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published