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

redis.auth

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis.auth - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

5

package.json
{
"name": "redis.auth",
"version": "0.1.0",
"version": "0.1.1",
"description": "A non prescriptive Redis Authentication module for Express",

@@ -33,3 +33,6 @@ "main": "index.js",

"supertest": "^1.2.0"
},
"dependencies": {
"redis.token": "^0.1.5"
}
}

54

README.md

@@ -0,2 +1,54 @@

[![Build Status](https://travis-ci.org/ChrisCates/redis.auth.svg?branch=master)](https://travis-ci.org/ChrisCates/redis.auth)
[![Coverage Status](https://coveralls.io/repos/github/ChrisCates/redis.auth/badge.svg?branch=master)](https://coveralls.io/github/ChrisCates/redis.auth?branch=master)
[![NPM](https://nodei.co/npm/redis.auth.png)](https://nodei.co/npm/redis.auth/)
# redis.auth
A non prescriptive Redis Authentication module for Express
## A non prescriptive Redis Authentication module for Express
### By Chris Cates :star:
### Installation
```
npm install redis.auth --save
```
### Configuration
Note that it requires redis.token npm module to work properly
```
var redis = require("redis.token")()
var auth = require("redis.auth")(redis, {
//Check for which Express header use when authenticating the client
"header": "authorization",
//The key in the redis session storage you want to check for
"key": "grantType",
//If return error is true it sends a 403 or 500 status based on the error
//Turn this off if you want to do your own error checking
"returnError": true
})
```
### Example status returns:
#### With returnError = true
```
return res.status(403).send({
"error": true,
"status": 403,
"message": "No "+config.header+" header supplied..."
})
```
#### With returnError = false
```
//Sets these variables in req so you can check for them on your own
req.error = true
req.errorType = "No "+config.header+" header supplied..."
req.errorCode = 403
return next()
```
#### Questions, email hello@chriscates.ca
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