You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
513 B

  1. # frozen_string_literal: true
  2. class Api::V1::Accounts::CredentialsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :write }, only: [:update]
  4. before_action :require_user!
  5. def show
  6. @account = current_account
  7. render 'api/v1/accounts/show'
  8. end
  9. def update
  10. current_account.update!(account_params)
  11. @account = current_account
  12. render 'api/v1/accounts/show'
  13. end
  14. private
  15. def account_params
  16. params.permit(:display_name, :note, :avatar, :header)
  17. end
  18. end