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.

17 lines
426 B

  1. # frozen_string_literal: true
  2. class Api::V1::Crypto::Keys::CountsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :crypto }
  4. before_action :require_user!
  5. before_action :set_current_device
  6. def show
  7. render json: { one_time_keys: @current_device.one_time_keys.count }
  8. end
  9. private
  10. def set_current_device
  11. @current_device = Device.find_by!(access_token: doorkeeper_token)
  12. end
  13. end