X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapioauthaccesstoken.php;h=6c3819c3bdff6dcc5b795b9e272d56874f05ff03;hb=dd5721848f80f4126dc2794099ecae8c42c67e62;hp=59abcf8120a449b47202aac55886eb01e44f2885;hpb=dc62cf1c0b6f77ebd4e4bf885aa3de7846b3232a;p=quix0rs-gnu-social.git diff --git a/actions/apioauthaccesstoken.php b/actions/apioauthaccesstoken.php index 59abcf8120..6c3819c3bd 100644 --- a/actions/apioauthaccesstoken.php +++ b/actions/apioauthaccesstoken.php @@ -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');