@AddonFlare because I'm developing a minimal external API, and won't have a CSRF token. I'm authenticating each request with HTTP Basic Auth instead.
@yoloswaggerino I truly wish it had given me a 5xx response code. But alas, it didn't, and I spent a lot of time trolling through the codebase...
And after trolling through the XF Code for almost 2 hours, I figured it out. CSRF Tokens. I just wish it all hadn't failed silently.
I cheated and added this function to my controller to bypass the checks.
public function checkCsrfIfNeeded($action, \XF\Mvc\ParameterBag $params)
{
return;
}
Doesn't look like you've connected to your ScotchBox. Go to the base directory and enter vagrant ssh. This should connect you to your vagrant box. Go to the xenforo directory, probably somewhere in /var/www/, and run the command from there.
Is there some kind of trick to getting this to work? My the action on my controller responds perfectly well to GET requests, but doesn't seem to be hit when I make the same request as a POST.
public function actionTest(\XF\Mvc\ParameterBag $params)
{
die("HERE");
}
Sorry to pull up an old thread, but I try this:
public function actionTest(){
$this->setResponseType('json');
return $this->view('Em8er\Auth:API', '', ["foo" => "bar"]);
}
And the response I get is this...