jfromaniello/passport-hawk — pull request #6 by drfloob (2014-03-13 08:35:08+00:00)
Title: Use `strategy.fail` instead of `strategy.error`

See descriptions for [`strategy.fail`](https://github.com/jaredhanson/passport/blob/a06f9b239c4ffaa2cfb134a6bd13a85fbad348b5/lib/middleware/authenticate.js#L259) and [`strategy.error`](https://github.com/jaredhanson/passport/blob/a06f9b239c4ffaa2cfb134a6bd13a85fbad348b5/lib/middleware/authenticate.js#L318). Using passport-hawk in koa.js, authentication errors were causing 500 Internal Server Errors to be returned. This fix causes authentication errors to return 401 Unauthorized responses by default.

All tests pass. Works as expected with koa + koa-passport.