<p>Called in the process of starting the <code>\XF\Api\App</code> object, when validating the API request credentials.</p>

<p>To override the default behavior, set <code>$result</code> to a user entity or, if triggering an error, false. If an error is triggered, set <code>$error</code> and <code>$code</code> as appropriate.</p>

<p>
	Alternatively, a <code><em>\XF\Http\Response</em></code> object may be returned to directly output a completely custom response. This can be used for more advanced error handling, for example.
</p>

<p>Callback signature:</p>
<blockquote><code><em>\XF\Http\Request</em> $request, &amp;$result, &amp;$error, &amp;$code</code></blockquote>

<p>Arguments:</p>
<ol>
	<li><code><em>\XF\Http\Request</em> $request</code> - API App object.</li>
	<li><code>$result</code> - if overriding the behavior, set this to a user entity or false.</li>
	<li><code>$error</code> - if setting the result to false, the phrase key of the error to return.</li>
	<li><code>$code</code> - if setting the result to false, the HTTP response code to use.</li>
</ol>