Open HerrLevin opened 5 months ago
Here is a small working patch for newly created träwelling instances:
Subject: [PATCH] Changes
---
Index: app/Http/Controllers/Frontend/Social/MastodonController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/Http/Controllers/Frontend/Social/MastodonController.php b/app/Http/Controllers/Frontend/Social/MastodonController.php
--- a/app/Http/Controllers/Frontend/Social/MastodonController.php
+++ b/app/Http/Controllers/Frontend/Social/MastodonController.php
@@ -47,7 +47,9 @@
session(['mastodon_server' => $server]);
try {
- return Socialite::driver('mastodon')->redirect();
+ return Socialite::driver('mastodon')
+ ->setScopes(config('services.mastodon.scopes'))
+ ->redirect();
} catch (Exception $exception) {
report($exception);
return back()->with('error', __('messages.exception.general'));
Index: config/services.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/config/services.php b/config/services.php
--- a/config/services.php
+++ b/config/services.php
@@ -49,5 +49,6 @@
'client_id' => env('MASTODON_ID'),
'client_secret' => env('MASTODON_SECRET'),
'redirect' => env('MASTODON_REDIRECT'),
+ 'scopes' => env('MASTODON_SCOPES', 'read:statuses write:statuses read:accounts'),
],
];
Index: app/Http/Controllers/Backend/Social/MastodonController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/Http/Controllers/Backend/Social/MastodonController.php b/app/Http/Controllers/Backend/Social/MastodonController.php
--- a/app/Http/Controllers/Backend/Social/MastodonController.php
+++ b/app/Http/Controllers/Backend/Social/MastodonController.php
@@ -94,7 +94,8 @@
$info = Mastodon::domain($domain)->createApp(
client_name: config('trwl.mastodon_appname'),
redirect_uris: config('trwl.mastodon_redirect'),
- scopes: 'write read'
+ scopes: config('services.mastodon.scopes'),
+ website: config('app.url')
);
return MastodonServer::updateOrCreate([
'domain' => $domain,
Describe the bug
Träwelling is requesting too many scopes on activitpub-servers ~that are not mastodon.~
Due to a recent discussion in #2768 and subsequent debugging I've come to the following conclusion:
Steps to reproduce
Browser console logs
Browser
All