mirror of
https://github.com/Thream/socketio-jwt.git
synced 2024-11-09 22:20:08 +01:00
Merged with master
This commit is contained in:
commit
93e6b59710
@ -115,8 +115,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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user