consulate/consulate — pull request #9 by CamShaft (2013-08-26 19:36:57+00:00)
Title: Add ability to overload callbacks

This adds a stack to each callback, useful for overloading the callbacks. If a callback cannot handle a certain request it should call `done('pass')` to try the next callback in the stack.

A great example of this is password hashing. Let's say in the beginning our users' passwords were hashed with pbkdf2 and now we want to start using scrypt. With this addition, it's trivial to use both. Just add both callbacks to the `verifyPassword` callback and you're set.