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

otto-authentication

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

otto-authentication - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

22

package.json
{
"name" : "otto-authentication",
"version" : "0.0.2",
"version" : "0.1.0",
"repository" : "https://github.com/ottojs/otto-authentication.git",
"main" : "./lib/index.js",
"dependencies" : {
"otto-errors" : "0.0.2",
"basic-auth" : "1.0.0"
"basic-auth" : "1.0.0",
"otto-errors" : "0.1.0"
},
"devDependencies" : {
"jshint" : "2.5.2",
"mocha" : "1.21.4",
"should" : "4.0.4",
"supertest" : "0.13.0",
"sinon" : "1.10.3",
"istanbul" : "0.3.0",
"otto" : "0.0.4"
"jshint" : "2.5.10",
"mocha" : "2.0.1",
"should" : "4.3.0",
"supertest" : "0.15.0",
"istanbul" : "0.3.2",
"otto" : "0.1.0"
},

@@ -23,5 +22,4 @@ "scripts" : {

"engines" : {
"node" : "0.10.x",
"npm" : "1.4.x"
"node" : "0.10.x"
}
}

@@ -13,33 +13,36 @@

// New Otto/Express App
var app = otto.app();
var app = otto.app({
routes : [
function (app) {
// Public Route
app.get('/public', function (req, res) {
res.status(200).send({ public_page : true });
});
// Public Route
app.get('/public', function (req, res) {
res.status(200).send({ public_page : true });
});
// Protected Route (bob/bobisthebest)
app.get('/protected', [
otto_authentication.http_basic('bob', 'bobisthebest'),
function (req, res) {
res.status(200).send({ protected_page : true });
}
]);
// Protected Route (bob/bobisthebest)
app.get('/protected', [
otto_authentication.http_basic('bob', 'bobisthebest'),
function (req, res) {
res.status(200).send({ protected_page : true });
}
]);
// Protected Route custom
app.get('/custom', [
otto_authentication.custom(function (req, allow) {
if (req.query.letmein && req.query.letmein === 'now') {
return allow(true);
// Protected Route custom
app.get('/custom', [
otto_authentication.custom(function (req, allow) {
if (req.query.letmein && req.query.letmein === 'now') {
return allow(true);
}
allow(false);
}),
function (req, res) {
res.status(200).send({ custom_authentication : true });
}
]);
}
allow(false);
}),
function (req, res) {
res.status(200).send({ custom_authentication : true });
}
]);
]
});
// Handle Errors
otto.error_handler(app);
// Bind SuperTest

@@ -46,0 +49,0 @@ var request = supertest(app);

Sorry, the diff of this file is not supported yet

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