summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1/api_controller.rb
blob: 54546048f85eb16f3ccd001ef8e9e88bc4311eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Api
  module V1
    class ApiController < ApplicationController
      before_action :restrict_access
      attr_reader :current_user

      private

      def restrict_access
        authenticate_or_request_with_http_token do |token, options|
          @current_user = User.find_by(authentication_token: token)
        end
      end
    end
  end
end