]> git.mxchange.org Git - friendica.git/commitdiff
Add support for Mastodon /authorize_interaction route
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 20 Nov 2022 00:55:01 +0000 (19:55 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 20 Nov 2022 00:55:01 +0000 (19:55 -0500)
- It is used by Fedifind to follow people who set their Webfinger address in their Twitter bio

src/Module/Contact/Follow.php
static/routes.config.php

index c274769402abe0ce509faa2da0fa8fabab266f82..f8b88c05fc7ab35686ede286500d988a34748736 100644 (file)
@@ -88,7 +88,9 @@ class Follow extends BaseModule
                }
 
                $uid = $this->session->getLocalUserId();
-               $url = Probe::cleanURI(trim($request['url'] ?? ''));
+
+               // uri is used by the /authorize_interaction Mastodon route
+               $url = Probe::cleanURI(trim($request['uri'] ?? $request['url'] ?? ''));
 
                // Issue 6874: Allow remote following from Peertube
                if (strpos($url, 'acct:') === 0) {
index 5f5c238e05b8497c9f60cdbc3aa7f0bfa3ce8f46..9adc8ec1dd7bfce13868a0a9af601c5f30486b16 100644 (file)
@@ -342,6 +342,10 @@ return [
        '/acctlink'            => [Module\Acctlink::class,     [R::GET]],
        '/apps'                => [Module\Apps::class,         [R::GET]],
        '/attach/{item:\d+}'   => [Module\Attach::class,       [R::GET]],
+
+       // Mastodon route used by Fedifind to follow people who set their Webfinger address in their Twitter bio
+       '/authorize_interaction' => [Module\Contact\Follow::class, [R::GET, R::POST]],
+
        '/babel'               => [Module\Debug\Babel::class,  [R::GET, R::POST]],
        '/debug/ap'            => [Module\Debug\ActivityPubConversion::class,  [R::GET, R::POST]],