about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-02 16:14:21 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-02 16:14:21 +0200
commit6d7290f47c11c08b55d6066d5123b8b9f04cf0bc (patch)
treea6fa07815a3f70252afc24edc9f202862425dfcf /app
parent31a0202546acb20094eb6367061e50f5525cc7ed (diff)
Add API for getting info about authenticated user: /api/v1/accounts/verify_credentials
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/accounts_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb
index 50e6df80e..d43306f7b 100644
--- a/app/controllers/api/v1/accounts_controller.rb
+++ b/app/controllers/api/v1/accounts_controller.rb
@@ -1,11 +1,16 @@
 class Api::V1::AccountsController < ApiController
   before_action :doorkeeper_authorize!
-  before_action :set_account
+  before_action :set_account, except: :verify_credentials
   respond_to    :json
 
   def show
   end
 
+  def verify_credentials
+    @account = current_user.account
+    render action: :show
+  end
+
   def following
     @following = @account.following
   end