I can't access current_user
in my api controller when sending a POST
request.
It says it is null.
class ApiController < ApplicationController
before_action :set_default_format
skip_before_action :verify_authenticity_token
private
def set_default_format
request.format = :json
end
end
class Api::V1::PhotosController < ApiController
...
end
What am I doing wrong? I read a couple of posts on SO and the solutions do not work.