ryanfitz/hapi-auth-jwt — pull request #13 by mdumouchel (2014-12-09 19:45:51+00:00)
Title: Added option for redirecting.

We have a case where we want to redirect our user to our login page. We can't do the redirect on the client since we check the token before even returning any client side code (server side rendered index).

I simply added a wrapper to the reply to check if a redirectUrl is set. If the Url is set reply.redirect to that instead of returning a 400, 401. Additionally if the validate is rejects the token it will follow same logic of redirecting if a url is available.