Socket
Socket
Sign inDemoInstall

jungles-auth-simple

Package Overview
Dependencies
18
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jungles-auth-simple

Simple authorization middleware


Version published
Maintainers
1
Install size
658 kB
Created

Readme

Source

Jungles Auth Simple

Simple authorization middleware. If a req.session.user is in the administrator array the request will get nexted otherwise you get redirected to the login string.

API

require('jungles-auth-simple')(/* string: login url */, /* array: [res.session.user] */)

Mount

var app = express();
app.use('/administrator', require('jungles-auth-simple')('/login', ['geert.pasteels@gmail.com']));     

Warning

This module only does authorization you still need authentication middleware that sets a req.session.user. Jungles Auth Persona is an example of such using Mozilla Persona.

Test

mocha.js and should.js is needed.

make test

Keywords

FAQs

Last updated on 15 Jun 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc