2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-11-09 22:20:08 +01:00

Merge pull request #161 from Root-Core/fixes

Fixed regressions of b0cd246 and 3128fdf
This commit is contained in:
Conrad Sopala 2019-10-09 12:11:24 +02:00 committed by GitHub
commit 945cb50d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -112,8 +112,8 @@ function noQsMethod(options) {
function authorize(options, onConnection) { function authorize(options, onConnection) {
options = xtend({ decodedPropertyName: 'decoded_token', encodedPropertyName: 'encoded_token' }, options); options = xtend({ decodedPropertyName: 'decoded_token', encodedPropertyName: 'encoded_token' }, options);
if (typeof options.secret !== 'string') { if (typeof options.secret !== 'string' && typeof options.secret !== 'function') {
throw new Error(`Provided secret "${options.secret}" is invalid, must be of type string.`) throw new Error('Provided secret "' + options.secret + '" is invalid, must be of type string or function.');
} }
if (!options.handshake) { if (!options.handshake) {

View File

@ -23,6 +23,8 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jsonwebtoken": "^8.3.0",
"xtend": "~2.1.2"
}, },
"devDependencies": { "devDependencies": {
"@types/socket.io": "~1.4.29", "@types/socket.io": "~1.4.29",
@ -31,8 +33,6 @@
"mocha": "~3.2.0", "mocha": "~3.2.0",
"request": "~2.81.0", "request": "~2.81.0",
"serve-static": "^1.12.1", "serve-static": "^1.12.1",
"jsonwebtoken": "^8.3.0",
"xtend": "~2.1.2",
"server-destroy": "~1.0.1", "server-destroy": "~1.0.1",
"should": "~11.2.1", "should": "~11.2.1",
"socket.io": "^1.7.3", "socket.io": "^1.7.3",