You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extend the ApiGuardController to allow for disabling the feature during development (based on APP_DEBUG) and "global" request limiting. It works just fine but I'm thinking about features that will be executed based on the validity of the key (e.g. e-mail notifications) but ApiGuardAuth::isAuthenticated() always returns false.
I'm extending the following custom controller in my own controllers.
<?phpnamespaceApp\Http\Controllers;
use \Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController;
useConfig;
useApiGuardAuth;
class ApiController extends ApiGuardController {
protected$apiMethods;
publicfunction__construct() {
// Disable API key authentication on development environmentsif ( !env('APP_DEBUG') ) {
parent::__construct();
$this->apiMethods = Config::get('api.api-guard');
// var_dump(ApiGuardAuth::isAuthenticated());
}
}
}
Why is it returning false and what would be the best way to determine whether the current request has a valid key?
Another (probably relevant) question I'm having is how to change the error object (GEN-UNAUTHORIZED a.o.) that gets returned?
The text was updated successfully, but these errors were encountered:
I'm trying to extend the
ApiGuardController
to allow for disabling the feature during development (based onAPP_DEBUG
) and "global" request limiting. It works just fine but I'm thinking about features that will be executed based on the validity of the key (e.g. e-mail notifications) butApiGuardAuth::isAuthenticated()
always returns false.I'm extending the following custom controller in my own controllers.
Why is it returning false and what would be the best way to determine whether the current request has a valid key?
Another (probably relevant) question I'm having is how to change the error object (
GEN-UNAUTHORIZED
a.o.) that gets returned?The text was updated successfully, but these errors were encountered: