Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-basic-auth

Package Overview
Dependencies
Maintainers
8
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-basic-auth - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

History.md

14

index.js
'use strict';
/**

@@ -6,4 +8,4 @@ * Module dependencies.

var auth = require('basic-auth');
var assert = require('assert');
const auth = require('basic-auth');
const assert = require('assert');

@@ -28,11 +30,11 @@ /**

return function *basicAuth(next){
var user = auth(this);
return function basicAuth(ctx, next){
const user = auth(ctx);
if (user && user.name == opts.name && user.pass == opts.pass) {
yield next;
return next();
} else {
this.throw(401);
ctx.throw(401);
}
};
};

@@ -5,7 +5,7 @@ {

"repository": "koajs/basic-auth",
"version": "1.1.2",
"version": "2.0.0",
"scripts": {
"test": "NODE_ENV=test mocha --harmony-generators --reporter spec",
"test-cov": "NODE_ENV=test node --harmony-generators ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha",
"test-travis": "NODE_ENV=test node --harmony-generators ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"
"test": "NODE_ENV=test mocha --reporter spec",
"test-cov": "NODE_ENV=test istanbul cover ./node_modules/.bin/_mocha",
"test-travis": "NODE_ENV=test istanbul cover ./node_modules/.bin/_mocha --report lcovonly"
},

@@ -23,11 +23,11 @@ "keywords": [

"devDependencies": {
"istanbul-harmony": "0",
"koa": "*",
"mocha": "^1.12.0",
"supertest": "0"
"istanbul": "0",
"koa": "^2.0.0-alpha.3",
"mocha": "2",
"supertest": "1"
},
"license": "MIT",
"dependencies": {
"basic-auth": "^1.0.0"
"basic-auth": "^1.0.3"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc