making sure redirect-to-login page always generate html

Hi Mario,

here is a testcase: https://gist.github.com/hugoArregui/5988834 

I'm not sure if this is the right fix, as I don't understand why the error is not triggered when I comment out the #5 line. However, this change seems aligned to the rest of the code, so I made this pull request. 

HIH