{"action":"opened","issue":{"url":"https://api.github.com/repos/dwyl/hapi-auth-jwt2/issues/84","labels_url":"https://api.github.com/repos/dwyl/hapi-auth-jwt2/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/dwyl/hapi-auth-jwt2/issues/84/comments","events_url":"https://api.github.com/repos/dwyl/hapi-auth-jwt2/issues/84/events","html_url":"https://github.com/dwyl/hapi-auth-jwt2/issues/84","id":101096484,"number":84,"title":"hapi.transmit.js throws \"Error: 'name' and 'value' are required for setHeader() when my validateFunc returns callback(null, true)","user":{"login":"rainabba","id":553630,"avatar_url":"https://avatars.githubusercontent.com/u/553630?v=3","gravatar_id":"","url":"https://api.github.com/users/rainabba","html_url":"https://github.com/rainabba","followers_url":"https://api.github.com/users/rainabba/followers","following_url":"https://api.github.com/users/rainabba/following{/other_user}","gists_url":"https://api.github.com/users/rainabba/gists{/gist_id}","starred_url":"https://api.github.com/users/rainabba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainabba/subscriptions","organizations_url":"https://api.github.com/users/rainabba/orgs","repos_url":"https://api.github.com/users/rainabba/repos","events_url":"https://api.github.com/users/rainabba/events{/privacy}","received_events_url":"https://api.github.com/users/rainabba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-14T20:21:10Z","updated_at":"2015-08-14T20:21:10Z","closed_at":null,"body":"When I `return callback(null, false)`, there is no error.\r\n\r\nThe full stack: `Debug: internal, implementation, error\r\n    Error: \"name\" and \"value\" are required for setHeader().\r\n    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:333:11)\r\n    at Object.internals.transmit (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:254:25)\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:34:26\r\n    at Function.internals.Auth.response (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\auth.js:406:16)\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:142:25\r\n    at internals.Response._streamify (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\response.js:491:12)\r\n    at internals.Response._marshal (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\response.js:437:21)\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:122:18\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:539:20\r\n    at done (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\node_modules\\items\\lib\\index.js:63:25)\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:512:20\r\n    at Object.exports.parallel (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\node_modules\\items\\lib\\index.js:70:13)\r\n    at Object.internals.state (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:508:11)\r\n    at Object.internals.marshal (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:96:15)\r\n    at Object.exports.send (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\transmit.js:27:15)\r\n    at C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\request.js:416:18\r\n    at finish (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\protect.js:45:16)\r\n    at wrapped (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\node_modules\\hoek\\lib\\index.js:858:20)\r\n    at done (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\node_modules\\items\\lib\\index.js:30:25)\r\n    at Function.wrapped (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\node_modules\\hoek\\lib\\index.js:858:20)\r\n    at Function.internals.continue (C:\\PRJ\\vtv\\git\\vantage-backend\\node_modules\\hapi\\lib\\reply.js:105:10)\r\n    at internalHandlers.onPreResponse (C:\\PRJ\\vtv\\git\\vantage-backend\\lib\\plugins\\registerInternalHandlers.js:38:30)`\r\n\r\n\r\n*My code for testing (just getting the plugin working)*\r\n```\r\njwtValidate = function(decoded, request, callback) {\r\n\t// do your checks to see if the person is valid\r\n\tvtv.logger.debug( { jwtDecoded: decoded } );\r\n\t//return callback(null, false);  // I get a proper 401, Invalid credentials here\r\n\treturn callback(null, true); // This throws the stack above\r\n}\r\n```\r\n\r\n*I'm registering the strategy with*\r\n```\r\nserver.auth.strategy('jwt', 'jwt', false, {\r\n\tkey: 'mysecretkey',\r\n\tvalidateFunc: jwtValidate,\r\n\tverifyOptions: {\r\n\t\talgorithms: ['HS256']\r\n\t},\r\n});\r\n```"}}