New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2.1 to 0.3.0

.nyc_output/30888.json

17

index.js

@@ -46,19 +46,8 @@ //Global variables

} else {
console.log("getting")
//If we do have a token in the header...
redis.get(req.headers[config.header], function(err,response) {
console.log("success")
req.auth = response
if (err) {
if (config.returnError == true) {
return res.status(500).send({
"error": true,
"status": 500,
"message": "Redis error..."
})
} else {
req.error = true
req.errorType = "Redis error..."
req.errorCode = 500
return next()
}
} else {
if (err) { return res.status(500).send(err) } else {
//Check permissions via grant type

@@ -65,0 +54,0 @@ if (Array.isArray(permissions)) {

{
"name": "redis.auth",
"version": "0.2.1",
"version": "0.3.0",
"description": "A non prescriptive Redis Authentication module for Express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,3 +20,3 @@ [![Build Status](https://travis-ci.org/ChrisCates/redis.auth.svg?branch=master)](https://travis-ci.org/ChrisCates/redis.auth)

```
``` javascript
var redis = require("redis.token")()

@@ -35,3 +35,3 @@ var auth = require("redis.auth")(redis, {

### Example Express middleware
```
``` javascript
var express = require("express")

@@ -44,2 +44,3 @@ var app = express()

app.get("/user", auth("user"), function(req,res) {
//req.auth = stored Redis.Token Object
return res.status(200).send("Only users can access this...")

@@ -50,2 +51,3 @@ })

app.get("/user", auth(["user", "admin"]), function(req,res) {
//req.auth = stored Redis.Token Object
return res.status(200).send("Admins and users can access this...")

@@ -64,4 +66,3 @@ })

```
req.auth = {Redis Object}
``` javascript
return res.status(403).send({

@@ -76,4 +77,3 @@ "error": true,

```
req.auth = {Redis Object}
``` javascript
//Sets these variables in req so you can check for them on your own

@@ -80,0 +80,0 @@ req.error = true

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