X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bf851691bf3eb9999e5624a04eef00db5800f5f0..51ba80dab3951e1847f414152a88c84941bc2e20:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b4c0fbc23..6fc31953d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base helper_method :current_user helper_method :oauth_token - helper_method :preferred_langauges + helper_method :preferred_languages private @@ -67,7 +67,7 @@ class ApplicationController < ActionController::Base end def require_oauth - @oauth_token = current_user.access_token(Settings.oauth_key) if current_user && Settings.key?(:oauth_key) + @oauth_token = current_user.oauth_token(Settings.oauth_application) if current_user && Settings.key?(:oauth_application) end ## @@ -345,7 +345,7 @@ class ApplicationController < ActionController::Base end def deny_access(_exception) - if current_token + if doorkeeper_token || current_token set_locale report_error t("oauth.permissions.missing"), :forbidden elsif current_user