rails-api

How do you use authenticate_with_http_token with rails-api?


I am using rails-api and need to use authenticate_with_http_token to process a header authorization token, but i get the following error:

NoMethodError (undefined method `authenticate_with_http_token' for ...)

Solution

  • Add the following to ApplicationController

    include ActionController::HttpAuthentication::Token::ControllerMethods