git.cweiske.de
/
grauphel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Send HTTP 401 on invalid token
[grauphel.git]
/
lib
/
tokenstorage.php
diff --git
a/lib/tokenstorage.php
b/lib/tokenstorage.php
index f8f0806f95b89d61f9f092c483852af42fb674ce..4b5f42094978a139c156a41aff6b8f3e1c47d5ac 100644
(file)
--- a/
lib/tokenstorage.php
+++ b/
lib/tokenstorage.php
@@
-95,12
+95,15
@@
class TokenStorage
)->fetchRow();
if ($tokenRow === false) {
)->fetchRow();
if ($tokenRow === false) {
- throw new OAuthException('Unknown token: ' . $type . ' / ' . $tokenKey);
+ throw new OAuthException(
+ 'Unknown token: ' . $type . ' / ' . $tokenKey,
+ OAUTH_TOKEN_REJECTED
+ );
}
$token = $this->fromDb($tokenRow);
if ($token->tokenKey != $tokenKey) {
}
$token = $this->fromDb($tokenRow);
if ($token->tokenKey != $tokenKey) {
- throw new OAuthException('Invalid token');
+ throw new OAuthException('Invalid token'
, OAUTH_TOKEN_REJECTED
);
}
return $token;
}
return $token;