3128fdf
: - Secret can be a string or function - Compatibility with older node versionsb0cd246
: - Fixed dependencies
This commit is contained in:
@ -111,9 +111,9 @@ 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) {
|
||||
|
Reference in New Issue
Block a user