From: Tom Hughes Date: Wed, 22 Sep 2010 17:29:27 +0000 (+0100) Subject: Update oauth support for rails 3 version of oauth plugin X-Git-Tag: live~6109 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1e13e6ae2d5326d93ec3c55daaac08d884d69265?hp=a92223a50672201070bbf659b1e99bbda6edadbd Update oauth support for rails 3 version of oauth plugin --- diff --git a/Gemfile b/Gemfile index 7e356e554..81a543eae 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'pg' gem 'libxml-ruby', '>= 2.0.5', :require => 'libxml' gem 'rmagick', :require => 'RMagick' gem 'oauth', '>= 0.4.3' -gem 'oauth-plugin', '>= 0.3.14' +gem 'oauth-plugin', '> 0.3.14' gem 'httpclient' gem 'SystemTimer', '>= 1.1.3', :require => 'system_timer' gem 'sanitize' diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5018dcc42..e22f64c76 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -106,7 +106,7 @@ class ApplicationController < ActionController::Base # is optional. def setup_user_auth # try and setup using OAuth - if oauthenticate + if Authenticator.new(self, [:token]).allow? @user = current_token.user else username, passwd = get_auth_data # parse from headers @@ -358,4 +358,8 @@ private return [user, pass] end + # override to stop oauth plugin sending errors + def invalid_oauth_response + end + end