]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/accesstoken.php
update TODOs and try to reformat notices
[quix0rs-gnu-social.git] / actions / accesstoken.php
index e28a9334542f83e214191c2c36a6840d4ec32c6d..6bb0e1561b3d3bfd3aee8159facd50f072a3794c 100644 (file)
@@ -22,6 +22,13 @@ if (!defined('LACONICA')) { exit(1); }
 class AccesstokenAction extends Action {
        function handle($args) {
                parent::handle($args);
-               common_server_error(_t('Not yet implemented.'));
+               try {
+                       $req = OAuthRequest::from_request();
+                       $server = common_oauth_server();
+                       $token = $server->fetch_access_token($req);
+                       print $token;
+               } catch (OAuthException $e) {
+                       common_server_error($e->getMessage());
+               }
        }
 }