Changeset View
Changeset View
Standalone View
Standalone View
src/applications/oauthserver/PhabricatorOAuthServer.php
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | $authorization = id(new PhabricatorOAuthClientAuthorizationQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withUserPHIDs(array($user_phid)) | ->withUserPHIDs(array($user_phid)) | ||||
->withClientPHIDs(array($client_phid)) | ->withClientPHIDs(array($client_phid)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$authorization) { | if (!$authorization) { | ||||
return null; | return null; | ||||
} | } | ||||
$application = $authorization->getClient(); | |||||
if ($application->getIsDisabled()) { | |||||
return null; | |||||
} | |||||
// TODO: This should probably be reworked; expiration should be an | // TODO: This should probably be reworked; expiration should be an | ||||
// exclusive property of the token. For now, this logic reads: tokens for | // exclusive property of the token. For now, this logic reads: tokens for | ||||
// authorizations with "offline_access" never expire. | // authorizations with "offline_access" never expire. | ||||
$is_expired = $token->isExpired(); | $is_expired = $token->isExpired(); | ||||
if ($is_expired) { | if ($is_expired) { | ||||
$offline_access = PhabricatorOAuthServerScope::SCOPE_OFFLINE_ACCESS; | $offline_access = PhabricatorOAuthServerScope::SCOPE_OFFLINE_ACCESS; | ||||
$authorization_scope = $authorization->getScope(); | $authorization_scope = $authorization->getScope(); | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |