Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GitLab.php

function GitLab::isOAuthExpired

Is the OAuth access token expired?

Return value

bool true on expired token, false if token is fresh or expiration date is not set

File

vendor/composer/composer/src/Composer/Util/GitLab.php, line 273

Class

GitLab
@author Roshan Gautam <roshan.gautam@hotmail.com>

Namespace

Composer\Util

Code

public function isOAuthExpired(string $originUrl) : bool {
    $authTokens = $this->config
        ->get('gitlab-oauth');
    if (isset($authTokens[$originUrl]['expires-at'])) {
        if ($authTokens[$originUrl]['expires-at'] < time()) {
            return true;
        }
    }
    return false;
}
RSS feed
Powered by Drupal