]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apioauthaccesstoken.php
* tag i18n issue.
[quix0rs-gnu-social.git] / actions / apioauthaccesstoken.php
index 59abcf8120a449b47202aac55886eb01e44f2885..6c3819c3bdff6dcc5b795b9e272d56874f05ff03 100644 (file)
@@ -76,18 +76,18 @@ class ApiOauthAccessTokenAction extends ApiOauthAction
 
             $this->reqToken = $req->get_parameter('oauth_token');
             $this->verifier = $req->get_parameter('oauth_verifier');
-            $app = $datastore->getAppByRequestToken($this->reqToken);
-            $atok = $server->fetch_access_token($req);
 
+            $app  = $datastore->getAppByRequestToken($this->reqToken);
+            $atok = $server->fetch_access_token($req);
         } catch (Exception $e) {
             common_log(LOG_WARNING, 'API OAuthException - ' . $e->getMessage());
             common_debug(var_export($req, true));
             $code = $e->getCode();
             $this->clientError($e->getMessage(), empty($code) ? 401 : $code, 'text');
+            return;
         }
 
         if (empty($atok)) {
-
             // Token exchange failed -- log it
 
             $msg = sprintf(
@@ -99,13 +99,12 @@ class ApiOauthAccessTokenAction extends ApiOauthAction
 
             common_log(LOG_WARNING, $msg);
             // TRANS: Client error given from the OAuth API when the request token or verifier is invalid.
-            $this->clientError(_("Invalid request token or verifier.", 400, 'text'));
-
+            $this->clientError(_("Invalid request token or verifier."), 400, 'text');
         } else {
             common_log(
                 LOG_INFO,
                 sprintf(
-                    "Issued now access token '%s' for application %d (%s).",
+                    "Issued access token '%s' for application %d (%s).",
                     $atok->key,
                     $app->id,
                     $app->name
@@ -120,7 +119,6 @@ class ApiOauthAccessTokenAction extends ApiOauthAction
      *
      * @param OAuthToken token the access token
      */
-
     function showAccessToken($token)
     {
         header('Content-Type: application/x-www-form-urlencoded');