http-auth-koa
Advanced tools
Comparing version
@@ -21,3 +21,3 @@ "use strict"; | ||
if (err) { | ||
next(err); | ||
throw err; | ||
} else { | ||
@@ -24,0 +24,0 @@ next(); |
{ | ||
"name": "http-auth-koa", | ||
"description": "Node.js package for HTTP basic and digest access authentication.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Gevorg Harutyunyan (http://github.com/gevorg)", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -34,9 +34,10 @@ # http-auth-koa | ||
// Setup auth. | ||
app.use(koaAuth(basic)); | ||
// Setup basic handler. | ||
app.use(async ctx => { | ||
ctx.body = `Welcome to koa ${ctx.request.user}!`; | ||
await next(); | ||
ctx.body = `Welcome to koa ${ctx.req.user}!`; | ||
}); | ||
// Setup auth. | ||
app.use(koaAuth(basic)); | ||
``` | ||
@@ -43,0 +44,0 @@ |
7697
0.22%93
1.09%