fix a bug in ensureAuthenticated.
Merge pull request #37 from wdholmes/master

ensureAuthenticated redirect fix