Merged with master

This commit is contained in:
Fabian Arndt 2019-10-13 15:55:36 +02:00
commit 93e6b59710

View File

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