fix owncloud.log notices
[grauphel.git] / lib / oauth.php
index d6c72e835daf2123cc6f95156b2e1d7a662f986c..5f84e7e319c62b87be689239cda8e5f51088a814 100644 (file)
@@ -98,7 +98,19 @@ class OAuth
 
     public function accessTokenHandler(\OAuthProvider $provider)
     {
-        $token = $this->tokens->load('access', $provider->token);
+        if ($provider->token == '') {
+            //conboy sends empty token when not authed yet
+            return OAUTH_PARAMETER_ABSENT;
+        }
+
+        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;
     }