]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
Move code that runs after user save from save_new_user to create method
[rails.git] / app / controllers / api_controller.rb
index 6ce8a0ef2d18045309e36784db5cb07d0f53483e..5a112b3cf61c4e4e35605b16086cf7bef6a6cc3e 100644 (file)
@@ -65,9 +65,9 @@ class ApiController < ApplicationController
   def current_ability
     # Use capabilities from the oauth token if it exists and is a valid access token
     if doorkeeper_token&.accessible?
-      ApiAbility.new(nil).merge(ApiCapability.new(doorkeeper_token))
+      ApiAbility.new(doorkeeper_token)
     else
-      ApiAbility.new(current_user)
+      ApiAbility.new(nil)
     end
   end
 
@@ -144,8 +144,8 @@ class ApiController < ApplicationController
 
   ##
   # wrap an api call in a timeout
-  def api_call_timeout(&block)
-    Timeout.timeout(Settings.api_timeout, &block)
+  def api_call_timeout(&)
+    Timeout.timeout(Settings.api_timeout, &)
   rescue ActionView::Template::Error => e
     e = e.cause