File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,10 @@ def get_or_create_fediverse_application(login_domain):
376
376
app = MastodonApplication .objects .filter (domain_name__iexact = domain ).first ()
377
377
if app :
378
378
return app
379
- allow_multiple_redir = True # TODO detect site supports multiple redirect uris
379
+ allow_multiple_redir = True
380
+ if "; Pixelfed" in server_version or server_version .startswith ("0." ):
381
+ # Pixelfed and GoToSocial don't support multiple redirect uris
382
+ allow_multiple_redir = False
380
383
response = create_app (api_domain , allow_multiple_redir )
381
384
if response .status_code != 200 :
382
385
logger .error (
Original file line number Diff line number Diff line change 2
2
3
3
from django .core .management .base import BaseCommand
4
4
5
- from mastodon .api import create_app
5
+ from mastodon .api import create_app , detect_server_info
6
6
from mastodon .models import MastodonApplication
7
7
8
8
@@ -20,7 +20,15 @@ def add_arguments(self, parser):
20
20
def handle (self , * args , ** options ):
21
21
if options ["refresh" ]:
22
22
for site in MastodonApplication .objects .exclude (disabled = True ):
23
+ try :
24
+ _ , _ , server_version = detect_server_info (site .api_domain )
25
+ except Exception :
26
+ continue
23
27
allow_multiple_redir = True
28
+ if "; Pixelfed" in server_version or server_version .startswith ("0." ):
29
+ allow_multiple_redir = False
30
+ if allow_multiple_redir :
31
+ continue
24
32
try :
25
33
response = create_app (site .api_domain , allow_multiple_redir )
26
34
except Exception as e :
You can’t perform that action at this time.
0 commit comments