Fix for redirect sign-in not working for all models

The previous pull request #455 didn't work for all controllers due to ordering of the authorization and authentication steps. This should hopefully cover everything.