Skip to content

Including HttpAuthentication problem #29

@krainboltgreene

Description

@krainboltgreene
class Api::V1::ApplicationController < ActionController::API
  include ActionController::HttpAuthentication::Basic::ControllerMethods

  before_filter :require_token

  private

  def require_token
    authenticate_or_request_with_http_token do |key, options|
      @current_user = Token.find_by_key(key).account if Token.exists?(key: key)
    end
  end
end

This results in the error:

NoMethodError: undefined method `authenticate_or_request_with_http_token' for #<Api::V1::AccountsController:0x007ffc81a50818>
    /Users/krainboltgreene/Code/Ruby/manacurve-api/app/controllers/api/v1/application_controller.rb:9:in `require_token'

As I understand it, including that module should allow me access to the Token auth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions