module Toke
  class ApplicationController < ActionController::Base
    protect_from_forgery with: :null_session

    include Toke::TokenAuthentication
  end
end

module Toke
  class ApplicationController < ActionController::API
    include ActionController::HttpAuthentication::Basic::ControllerMethods
    include Toke::TokenAuthentication
  end
end

Use ActionController::API instead of ::Base
Use ActionController::API instead of ::Base
