bnoguchi/everyauth — pull request #198 by pirxpilot (2012-03-01 03:48:08+00:00)
Title: support external redirect mapping

express has rather elegant methods for [redirect mapping](http://expressjs.com/guide.html#res.redirect\(\)).
It is possible to use it with current everyauth implementation, but you need to overwrite several methods performing redirects, which might be different for each module.

This commit changes all redirects to `this.redirect`, which is not strictly necessary. It internally calls
`everymodule.performRedirect` which might be conveniently overwritten.

Default implementation of `performRedirect`:

```javascript
res.writeHead(303, { 'Location': location });
res.end();
```

Defining a single redirect function that all modules use allows for centralized redirect mapping. Specifically express users may want to deploy res.redirect to implement successful login redirection.