aboutsummaryrefslogtreecommitdiff
path: root/lib/oauth.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-09-26 14:32:03 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-09-26 14:32:03 +0200
commit9a1ac6227c65296a4751c3e601cc1eb47398a77e (patch)
treec162acd7338c62a9c939eadcf17710b16b64b81a /lib/oauth.php
parent21e7415fe5a418ef6dd7f29d3749b11cc9adaa7d (diff)
downloadgrauphel-9a1ac6227c65296a4751c3e601cc1eb47398a77e.tar.gz
grauphel-9a1ac6227c65296a4751c3e601cc1eb47398a77e.zip
Send HTTP 401 on invalid token
Diffstat (limited to 'lib/oauth.php')
-rw-r--r--lib/oauth.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/oauth.php b/lib/oauth.php
index 6900c20..5f84e7e 100644
--- a/lib/oauth.php
+++ b/lib/oauth.php
@@ -103,7 +103,14 @@ class OAuth
return OAUTH_PARAMETER_ABSENT;
}
- $token = $this->tokens->load('access', $provider->token);
+ try {
+ $token = $this->tokens->load('access', $provider->token);
+ } catch (OAuthException $e) {
+ if ($e->getCode() == OAUTH_TOKEN_REJECTED) {
+ return OAUTH_TOKEN_REJECTED;
+ }
+ throw $e;
+ }
$provider->token_secret = $token->secret;
return OAUTH_OK;
}