add DELETE /token/$username/$tokenKey API
[grauphel.git] / lib / oauth.php
index 5f84e7e319c62b87be689239cda8e5f51088a814..231a177cfc2cd177cd3afeddda624d758b6758e2 100644 (file)
@@ -111,6 +111,12 @@ class OAuth
             }
             throw $e;
         }
             }
             throw $e;
         }
+
+        if (time() - $token->lastuse > 60) {
+            //time to update lastuse after at least a minute
+            $this->tokens->updateLastUse($token->tokenKey);
+        }
+
         $provider->token_secret = $token->secret;
         return OAUTH_OK;
     }
         $provider->token_secret = $token->secret;
         return OAUTH_OK;
     }
@@ -147,7 +153,7 @@ class OAuth
     /**
      * Get a new oauth provider instance.
      * Used to work around the fastcgi bug in oauthprovider.
     /**
      * Get a new oauth provider instance.
      * Used to work around the fastcgi bug in oauthprovider.
-     * 
+     *
      * @return \OAuthProvider
      */
     public static function getProvider()
      * @return \OAuthProvider
      */
     public static function getProvider()