@thream/socketio-jwt
Advanced tools
Comparing version 3.1.0 to 3.1.1
import jwt from 'jsonwebtoken'; | ||
import { UnauthorizedError } from './UnauthorizedError.js'; | ||
export const authorize = (options)=>{ | ||
const { secret , algorithms =[ | ||
const { secret, algorithms = [ | ||
'HS256' | ||
] , onAuthentication } = options; | ||
], onAuthentication } = options; | ||
return async (socket, next)=>{ | ||
let encodedToken = null; | ||
const { token } = socket.handshake.auth; | ||
const { token } = socket.handshake.auth; | ||
if (token != null) { | ||
@@ -11,0 +11,0 @@ const tokenSplitted = token.split(' '); |
{ | ||
"name": "@thream/socketio-jwt", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"type": "module", | ||
@@ -11,3 +11,5 @@ "public": true, | ||
"files": [ | ||
"build" | ||
"build", | ||
"!**/*.test.js", | ||
"!**/*.test.d.ts" | ||
], | ||
@@ -27,3 +29,3 @@ "engines": { | ||
], | ||
"author": "Divlo <contact@divlo.fr>", | ||
"author": "Théo LUDWIG <contact@theoludwig.fr>", | ||
"repository": { | ||
@@ -44,4 +46,4 @@ "type": "git", | ||
"lint:markdown": "markdownlint-cli2", | ||
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"", | ||
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"", | ||
"lint:eslint": "eslint . --ignore-path .gitignore", | ||
"lint:prettier": "prettier . --check --ignore-path .gitignore", | ||
"lint:staged": "lint-staged", | ||
@@ -61,17 +63,17 @@ "test": "c8 tap", | ||
"devDependencies": { | ||
"@commitlint/cli": "17.6.3", | ||
"@commitlint/config-conventional": "17.6.3", | ||
"@commitlint/cli": "17.6.6", | ||
"@commitlint/config-conventional": "17.6.6", | ||
"@swc/cli": "0.1.62", | ||
"@swc/core": "1.3.57", | ||
"@swc/core": "1.3.67", | ||
"@tsconfig/strictest": "2.0.1", | ||
"@types/jsonwebtoken": "9.0.2", | ||
"@types/node": "20.1.4", | ||
"@types/node": "20.3.3", | ||
"@types/tap": "15.0.8", | ||
"@typescript-eslint/eslint-plugin": "5.59.5", | ||
"@typescript-eslint/parser": "5.59.5", | ||
"@typescript-eslint/eslint-plugin": "5.60.1", | ||
"@typescript-eslint/parser": "5.60.1", | ||
"axios": "1.4.0", | ||
"c8": "7.13.0", | ||
"editorconfig-checker": "5.0.1", | ||
"eslint": "8.40.0", | ||
"eslint-config-conventions": "9.0.0", | ||
"c8": "8.0.0", | ||
"editorconfig-checker": "5.1.1", | ||
"eslint": "8.44.0", | ||
"eslint-config-conventions": "10.0.0", | ||
"eslint-config-prettier": "8.8.0", | ||
@@ -82,16 +84,16 @@ "eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-unicorn": "47.0.0", | ||
"fastify": "4.17.0", | ||
"fastify": "4.19.1", | ||
"husky": "8.0.3", | ||
"lint-staged": "13.2.2", | ||
"markdownlint-cli2": "0.7.1", | ||
"markdownlint-rule-relative-links": "1.2.0", | ||
"lint-staged": "13.2.3", | ||
"markdownlint-cli2": "0.8.1", | ||
"markdownlint-rule-relative-links": "2.1.0", | ||
"pinst": "3.0.0", | ||
"prettier": "2.8.8", | ||
"rimraf": "5.0.0", | ||
"semantic-release": "21.0.2", | ||
"socket.io": "4.6.1", | ||
"socket.io-client": "4.6.1", | ||
"tap": "16.3.4", | ||
"rimraf": "5.0.1", | ||
"semantic-release": "21.0.6", | ||
"socket.io": "4.7.1", | ||
"socket.io-client": "4.7.1", | ||
"tap": "16.3.7", | ||
"typescript": "5.0.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
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
15607
11
209
2