jungles-auth-simple

2.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i jungles-auth-simple

Weekly Downloads

2

Version

2.0.0

License

none

Last publish

Collaborators

  • enome