about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-11 16:47:36 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-11 16:47:36 +0100
commit447cfef62d74a670ddd600c0240f41746ac2fe0a (patch)
tree5c3ed8838f90435b4c4c52a366059cbbd2a24a67 /app/controllers
parentb919f39b3186c5f022d3965cf6023ff9041e91ca (diff)
Improving feed queries, switching API to doorkeeper authentication
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/accounts_controller.rb2
-rw-r--r--app/controllers/api/follows_controller.rb2
-rw-r--r--app/controllers/api/statuses_controller.rb2
-rw-r--r--app/controllers/api_controller.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/api/accounts_controller.rb b/app/controllers/api/accounts_controller.rb
index fc4c9d681..ac16ed7c1 100644
--- a/app/controllers/api/accounts_controller.rb
+++ b/app/controllers/api/accounts_controller.rb
@@ -1,6 +1,6 @@
 class Api::AccountsController < ApiController
   before_action :set_account
-  before_action :authenticate_user!
+  before_action :doorkeeper_authorize!
   respond_to    :json
 
   def show
diff --git a/app/controllers/api/follows_controller.rb b/app/controllers/api/follows_controller.rb
index acf627a07..9ec4f46b8 100644
--- a/app/controllers/api/follows_controller.rb
+++ b/app/controllers/api/follows_controller.rb
@@ -1,5 +1,5 @@
 class Api::FollowsController < ApiController
-  before_action :authenticate_user!
+  before_action :doorkeeper_authorize!
   respond_to    :json
 
   def create
diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb
index 04128537a..951f7113a 100644
--- a/app/controllers/api/statuses_controller.rb
+++ b/app/controllers/api/statuses_controller.rb
@@ -1,5 +1,5 @@
 class Api::StatusesController < ApiController
-  before_action :authenticate_user!
+  before_action :doorkeeper_authorize!
   respond_to    :json
 
   def show
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index d24f63f27..80d084328 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -4,7 +4,7 @@ class ApiController < ApplicationController
   protected
 
   def current_resource_owner
-    User.find(doorkeeper_token.user_id) if doorkeeper_token
+    User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
   end
 
   def current_user