You are here

public function ApiAuthorize::isAuthorized in FormAssembly 8

Checks for a valid authorization token.

Return value

bool If there is such a valid token.

File

src/ApiAuthorize.php, line 138

Class

ApiAuthorize
Service class for FormAssembly API: Handles authorization.

Namespace

Drupal\formassembly

Code

public function isAuthorized() {

  /** @var \League\OAuth2\Client\Token\AccessToken $accessToken */
  $accessToken = $this->state
    ->get('fa_form.access_token');
  return isset($accessToken) && !$accessToken
    ->hasExpired();
}