Make compatible with OmniAuth.config.mock_auth

Fixed two issues that make the controller and model authentication break tests using OmniAuth mocks.
See https://github.com/intridea/omniauth/wiki/Integration-Testing