]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Merge remote-tracking branch 'upstream/pull/3264'
[rails.git] / app / controllers / application_controller.rb
index b4c0fbc23feb7a5f1fb5c4f1482f740357fde78c..8df126a04e3a5ea02325b652dc0f0432cf08b5ab 100644 (file)
@@ -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