X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ba503e02d205e132881f7cd860d160c9562fb1b1..d04852fa47f5762f88ab91c2653d2f6224932406:/app/controllers/api_controller.rb diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 7e1b06a8d..686e81630 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -112,8 +112,6 @@ class ApiController < ApplicationController # authenticate per-scheme self.current_user = if username.nil? nil # no authentication provided - perhaps first connect (client should retry after 401) - elsif username == "token" - User.authenticate(:token => passwd) # preferred - random token for user from db, passed in basic auth else User.authenticate(:username => username, :password => passwd) # basic auth end @@ -177,7 +175,7 @@ class ApiController < ApplicationController ## # wrap an api call in a timeout def api_call_timeout(&block) - Timeout.timeout(Settings.api_timeout, Timeout::Error, &block) + Timeout.timeout(Settings.api_timeout, &block) rescue ActionView::Template::Error => e e = e.cause