I am using restful_Authentication plugin combined with the built-in http_basic authentication Rails 2.0.2
The following code in my controller seemed to work fine,
1. before_filter :authenticate 2. 3. def authenticate 4. case request.format 5. when Mime::XML, Mime::ATOM 6. if user = authenticate_with_http_basic { |name, pass> User.authenticate(name, pass) } 7. @current_user = user 8. else 9. request_http_basic_authentication 10. end 11. else 12. login_required if action_name != 'index' 13. return true 14. end 15. end
Then I started seeing this error whenever I accessed any action in my controller and also while accessing the login, logout actions as well. I can't seem to get rid of it.
NameError in MyController#index
uninitialized constant AuthenticatedSystem::Base64
RAILS_ROOT: C:/railsapps/Myapp Application Trace | Framework Trace | Full Trace
vendor/rails/activesupport/lib/active_support/dependencies.rb:263:in `load_missing_constant' vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in `const_missing' lib/authenticated_system.rb:126:in `get_auth_data' lib/authenticated_system.rb:105:in `login_from_basic_auth' lib/authenticated_system.rb:12:in `current_user' lib/authenticated_system.rb:6:in `logged_in?' lib/authenticated_system.rb:34:in `authorized?' lib/authenticated_system.rb:52:in `login_required' app/controllers/opinions_controller.rb:166:in `authenticate' script\server:3
Can anybody shed some light on this?
Thanks