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
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.
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()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:
You can check by putting after:
@e0ipso What your think ?
The text was updated successfully, but these errors were encountered: