{"action":"opened","issue":{"url":"https://api.github.com/repos/fastify/fastify-auth/issues/22","repository_url":"https://api.github.com/repos/fastify/fastify-auth","labels_url":"https://api.github.com/repos/fastify/fastify-auth/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/fastify/fastify-auth/issues/22/comments","events_url":"https://api.github.com/repos/fastify/fastify-auth/issues/22/events","html_url":"https://github.com/fastify/fastify-auth/issues/22","id":369258419,"node_id":"MDU6SXNzdWUzNjkyNTg0MTk=","number":22,"title":"Using multiple strategies does not work","user":{"login":"vorillaz","id":1022166,"node_id":"MDQ6VXNlcjEwMjIxNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1022166?v=4","gravatar_id":"","url":"https://api.github.com/users/vorillaz","html_url":"https://github.com/vorillaz","followers_url":"https://api.github.com/users/vorillaz/followers","following_url":"https://api.github.com/users/vorillaz/following{/other_user}","gists_url":"https://api.github.com/users/vorillaz/gists{/gist_id}","starred_url":"https://api.github.com/users/vorillaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorillaz/subscriptions","organizations_url":"https://api.github.com/users/vorillaz/orgs","repos_url":"https://api.github.com/users/vorillaz/repos","events_url":"https://api.github.com/users/vorillaz/events{/privacy}","received_events_url":"https://api.github.com/users/vorillaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-11T18:52:41Z","updated_at":"2018-10-11T18:52:41Z","closed_at":null,"author_association":"NONE","body":"Hey, thanks for the lovely work.\r\nI was playing around with `fastify-auth` and I can't actually create a steady case with multiple strategies. Apparently, something does not work as expected. Using the example below the authentication flow does not pass by `bar()` strategy.\r\n\r\n```\r\nconst Fastify = require('fastify');\r\n\r\nconst build = (opts = {}) => {\r\n  const fastify = Fastify(opts);\r\n  const routes = () => {\r\n    fastify.get(\r\n      '/',\r\n      {\r\n        beforeHandler: fastify.auth([fastify.foo, fastify.bar])\r\n      },\r\n      (request, reply) => ({hello: 'world'})\r\n    );\r\n  };\r\n  return fastify\r\n    .register(require('fastify-auth'))\r\n    .decorate('foo', (req, rep, done) => {\r\n      console.log('foo');\r\n      done();\r\n    })\r\n    .decorate('bar', (req, rep, done) => {\r\n      console.log('bar');\r\n      done();\r\n    })\r\n    .after(routes);\r\n};\r\n\r\nconst fastify = build();\r\nfastify.listen(3000, err => {\r\n  if (err) throw err;\r\n  console.log(`Server listenting at http://localhost:${fastify.server.address().port}`);\r\n});\r\n```\r\n\r\nAny help will be highly appreciated."}}
{"actor":{"display_login":"vorillaz"}}