I know this was a little while ago but wanted to put an answer here because this actually took me a bit to solve and other people might have a similar issue.
Because you used an initializer to load the User:ParameterSanitizer when you change the application controller or anything that would cause it to reload (because you are in debug mode) the initialization is lost.
This is easy to test to confirm this is what was happening to you: First: start the server fresh and go to your login page: should work. Next: modify application_controller.rb (just put a space somewhere and hit save) Next: visit your login page again (not working anymore) :(