Page MenuHomePhabricator

D9937.diff
No OneTemporary

D9937.diff

diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php
--- a/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php
+++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php
@@ -239,8 +239,17 @@
PHUIObjectItemView $item,
PhabricatorExternalAccount $account) {
- // Get a valid token, possibly refreshing it.
- $oauth_token = $this->getOAuthAccessToken($account);
+ // Get a valid token, possibly refreshing it. If we're unable to refresh
+ // it, render a message to that effect. The user may be able to repair the
+ // link by manually reconnecting.
+
+ $is_invalid = false;
+ try {
+ $oauth_token = $this->getOAuthAccessToken($account);
+ } catch (Exception $ex) {
+ $oauth_token = null;
+ $is_invalid = true;
+ }
$item->addAttribute(pht('OAuth2 Account'));
@@ -256,6 +265,8 @@
pht(
'Active OAuth Token'));
}
+ } else if ($is_invalid) {
+ $item->addAttribute(pht('Invalid OAuth Access Token'));
} else {
$item->addAttribute(pht('No OAuth Access Token'));
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 10:34 AM (17 h, 55 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6913642
Default Alt Text
D9937.diff (1 KB)

Event Timeline