Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Http/Controllers/Backend/Social/MastodonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ private static function createMastodonServer(string $domain): MastodonServer
{
try {
$info = Mastodon::domain($domain)->createApp(
client_name: config('services.mastodon.client_name'), // TODO: why is client name required here?
client_name: config('services.mastodon.client_name'),
redirect_uris: config('services.mastodon.redirect'),
scopes: 'write read',
scopes: config('services.mastodon.scopes'),
website: config('app.url')
);

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Frontend/Social/MastodonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public function redirect(Request $request): SympfonyRedirectResponse|RedirectRes
session(['mastodon_server' => $server]);

try {
return Socialite::driver('mastodon')->redirect();
return Socialite::driver('mastodon')
->setScopes(explode(' ', config('services.mastodon.scopes')))
->redirect();
} catch (Exception $exception) {
report($exception);

Expand Down
3 changes: 2 additions & 1 deletion config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

'mastodon' => [
'domain' => env('MASTODON_DOMAIN'),
'client_name' => env('MASTODON_APPNAME'), // TODO: check if this is a required value...? I don't think, we need this. ~@kris
'client_name' => env('MASTODON_APPNAME', 'Träwelling'),
'client_id' => env('MASTODON_ID'),
'client_secret' => env('MASTODON_SECRET'),
'redirect' => env('MASTODON_REDIRECT', 'http://localhost:8000/callback/mastodon'),
'timeout' => env('MASTODON_TIMEOUT_SECONDS', 2),
'scopes' => env('MASTODON_SCOPES', 'read:statuses write:statuses read:accounts'),
],

'telegram' => [
Expand Down
Loading