Differential D15593 Diff 37613 src/applications/oauthserver/storage/PhabricatorOAuthServerAccessToken.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/oauthserver/storage/PhabricatorOAuthServerAccessToken.php
Show All 16 Lines | return array( | ||||
'token' => array( | 'token' => array( | ||||
'columns' => array('token'), | 'columns' => array('token'), | ||||
'unique' => true, | 'unique' => true, | ||||
), | ), | ||||
), | ), | ||||
) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
} | } | ||||
public function isExpired() { | |||||
$now = PhabricatorTime::getNow(); | |||||
$expires_epoch = $this->getExpiresEpoch(); | |||||
return ($now > $expires_epoch); | |||||
} | |||||
public function getExpiresEpoch() { | |||||
return $this->getDateCreated() + 3600; | |||||
} | |||||
public function getExpiresDuration() { | |||||
return PhabricatorTime::getNow() - $this->getExpiresEpoch(); | |||||
} | |||||
} | } |