I encounter a problem with asynchronous requests.
I have set the token lifetime to 1 hour.
Module Version:
version = "7.x-2.16"
core = "7.x"
project = "restful"
datestamp = "1487139488"
Sometimes a Notice pops up when accessing a Resource.
Example:
\Drupal\test_api\Plugin\resource\TestResource__1_0::access
public function access(): ?bool {
$isAccess = parent::access();
$isUserGrantAccess = user_access('api_create_test_content', $this->getAccount());
if ($isAccess === FALSE || $isUserGrantAccess === FALSE) {
throw new RestfulException(
t(
'You dont have access to the functionality. Contact your administrator.'
), 403
);
}
return $isAccess && $isUserGrantAccess;
}
The $this->getAccount () method throws Notice: Trying to get property of non-object in the Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication->authenticate()function
This is because
\Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication
$auth_token = entity_load_single ('restful_token_auth', $id);
will return FALSE.
Additional information from the description:
entity_load_single
* @return
* The entity object, or FALSE.
You can check by putting after:
$auth_token = entity_load_single('restful_token_auth', $id);
$auth_token = FALSE;
@e0ipso What your think ?
I encounter a problem with asynchronous requests.
I have set the token lifetime to 1 hour.
Module Version:
Sometimes a Notice pops up when accessing a Resource.
Example:
The $this->getAccount () method throws Notice: Trying to get property of non-object in the Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication->authenticate()functionThis is because
\Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication$auth_token = entity_load_single ('restful_token_auth', $id);will return FALSE.
Additional information from the description:
You can check by putting after:
@e0ipso What your think ?