@remap/authenticate-middleware
Advanced tools
Comparing version 1.1.0 to 1.1.1
const { STATUS_CODES } = require('http') | ||
const { createError } = require('micro-errors') | ||
const { Authentication } = require('@remap/services') | ||
const ReMap = require('@remap/services') | ||
@@ -10,5 +10,6 @@ const STATUS_MESSAGE_400 = STATUS_CODES[400] | ||
module.exports = ({ authenticate = Authentication.authenticate } = {}) => { | ||
module.exports = ({ authenticate } = {}) => { | ||
if (typeof authenticate !== 'function') { | ||
throw new TypeError('`authenticate` service client must be function') | ||
const remap = new ReMap() | ||
authenticate = remap.authenticate.bind(remap) | ||
} | ||
@@ -15,0 +16,0 @@ |
{ | ||
"name": "@remap/authenticate-middleware", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "ReMap Authenticate Middleware", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@remap/services": "^1.1.0", | ||
"@remap/services": "^2.0.0", | ||
"micro-errors": "^2.0.0" | ||
@@ -37,3 +37,3 @@ }, | ||
"cross-fetch": "^2.2.2", | ||
"eslint": "^5.5.0", | ||
"eslint": "^5.6.1", | ||
"eslint-plugin-ava": "^5.1.1", | ||
@@ -40,0 +40,0 @@ "eslint-plugin-node": "^7.0.1", |
@@ -22,2 +22,10 @@ # authenticate-middleware | ||
// req.auth | ||
// { | ||
// name: string; | ||
// picture: string; | ||
// auth_time: number; | ||
// email: string; | ||
// email_verified: boolean; | ||
// uid: string; | ||
// } | ||
} | ||
@@ -30,5 +38,5 @@ ) | ||
```js | ||
const middlwware = authenticateMiddleware({ | ||
const middleware = authenticateMiddleware({ | ||
authenticate: async () => await doSomething(), | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3159
31
41
1
+ Added@remap/services@2.0.0(transitive)
- Removed@remap/services@1.1.0(transitive)
Updated@remap/services@^2.0.0