Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def http_basic_authentication
- if request.format == Mime::XML
- authenticate_or_request_with_http_basic do |username, api_key|
- self.current_user = User.find(:first, :from => 'users, accounts', :conditions => ["accounts.id = users.account_id AND accounts.api_key = ?", api_key])
- end
- end
- end
- self.current_user = Account.find_by_api_key(api_key).user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement