protect_from_forgery
if STATUS == :database_readonly or STATUS == :database_offline
- session :off
+ after_filter :clear_session
+ wrap_parameters false
+
+ def clear_session
+ session.clear
+ end
def self.cache_sweeper(*sweepers)
end
# is optional.
def setup_user_auth
# try and setup using OAuth
- if Authenticator.new(self, [:token]).allow?
- @user = current_token.user
- else
+ if not Authenticator.new(self, [:token]).allow?
username, passwd = get_auth_data # parse from headers
# authenticate per-scheme
if username.nil?
return [user, pass]
end
+ # used by oauth plugin to set the current user
+ def current_user=(user)
+ @user=user
+ end
+
# override to stop oauth plugin sending errors
def invalid_oauth_response
end