diff --git a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php index 97957d7c91..b36f28e0dc 100644 --- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php @@ -72,7 +72,7 @@ final class PhabricatorAuthManagementRefreshWorkflow $console->writeOut( "%s\n", pht( - "Found %s accounts to refresh.", + "Found %s account(s) to refresh.", new PhutilNumber(count($accounts)))); } @@ -126,7 +126,13 @@ final class PhabricatorAuthManagementRefreshWorkflow new PhutilNumber( $account->getProperty('oauth.token.access.expires') - time()))); - $provider->getOAuthAccessToken($account, $force_refresh = true); + $token = $provider->getOAuthAccessToken($account, $force_refresh = true); + if (!$token) { + $console->writeOut( + "* %s\n", + pht('Unable to refresh token!')); + continue; + } $console->writeOut( "+ %s\n", diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuth.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuth.php index 7c9ed7edac..88d1b60369 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderOAuth.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuth.php @@ -339,6 +339,8 @@ abstract class PhabricatorAuthProviderOAuth extends PhabricatorAuthProvider { $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); $account->save(); unset($unguarded); + + return $account->getProperty('oauth.token.access'); } }