@thream/socketio-jwt
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,3 +0,9 @@ | ||
# [1.0.0](https://github.com/Thream/socketio-jwt/compare/v4.6.2...v1.0.0) (2020-12-29) | ||
# Changelog | ||
## [1.0.1](https://github.com/Thream/socketio-jwt/compare/v1.0.0...v1.0.1) (2020-12-29) | ||
- docs(readme): fix usage section by correctly importing `authorize` | ||
## [1.0.0](https://github.com/Thream/socketio-jwt/compare/v4.6.2...v1.0.0) (2020-12-29) | ||
Initial release. |
{ | ||
"name": "@thream/socketio-jwt", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Authenticate socket.io incoming connections with JWTs.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
<h1 align="center">Thream/socketio-jwt</h1> | ||
<h1 align="center"><a href="https://www.npmjs.com/package/@thream/socketio-jwt">Thream/socketio-jwt</a></h1> | ||
@@ -11,2 +11,3 @@ <p align="center"> | ||
<a href="https://dependabot.com/"><img src="https://badgen.net/github/dependabot/Thream/socketio-jwt?icon=dependabot" alt="Dependabot badge" /></a> | ||
<a href="https://www.npmjs.com/package/@thream/socketio-jwt"><img src="https://img.shields.io/npm/v/@thream/socketio-jwt.svg" alt="npm version"></a> | ||
<a href="https://www.npmjs.com/package/ts-standard"><img alt="TypeScript Standard Style" src="https://camo.githubusercontent.com/f87caadb70f384c0361ec72ccf07714ef69a5c0a/68747470733a2f2f62616467656e2e6e65742f62616467652f636f64652532307374796c652f74732d7374616e646172642f626c75653f69636f6e3d74797065736372697074"/></a> | ||
@@ -38,3 +39,3 @@ <a href="./LICENSE"><img src="https://img.shields.io/badge/licence-MIT-blue.svg" alt="Licence MIT"/></a> | ||
import { Server } from 'socket.io' | ||
import socketioJWT from '@thream/socketio-jwt' | ||
import { authorize } from '@thream/socketio-jwt' | ||
@@ -52,3 +53,5 @@ const io = new Server(9000) | ||
const client = io.sockets.sockets.get(clientId) | ||
console.log(client.decodedToken) // we can access the jwt payload of each connected client | ||
client.emit('messages', { message: 'Success!' }) | ||
// we can access the jwt payload of each connected client | ||
console.log(client.decodedToken) | ||
} | ||
@@ -55,0 +58,0 @@ }) |
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
14968
90