diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index f50a0b6..25d407a 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -12,14 +12,14 @@ use Socialite; */ class LoginController extends Controller { - /** - * Direct the user to the Mastodon OAuth login page. - * - * First check to see if we are registered as an app with the Mastodon API, - * then direct users to the OAuth login. - * - * @return Illuminate\Http\RedirectResponse Redirect to the OAuth login. - */ + /** + * Direct the user to the Mastodon OAuth login page. + * + * First check to see if we are registered as an app with the Mastodon API, + * then direct users to the OAuth login. + * + * @return Illuminate\Http\RedirectResponse Redirect to the OAuth login. + */ public function login() { # Check if this app is already registered. @@ -70,7 +70,9 @@ class LoginController extends Controller session(['client_secret' => $client_secret]); # Redirect the user to their instance to log in. - return Socialite::driver('mastodon')->redirect(); + return Socialite::driver('mastodon') + ->setScopes(config('services.mastodon.scope', config('services.mastodon.scopes'))) + ->redirect(); } /** diff --git a/config/services.php b/config/services.php index a35b452..274b1e1 100644 --- a/config/services.php +++ b/config/services.php @@ -41,6 +41,6 @@ return [ 'client_secret' => env('MASTODON_SECRET'), 'redirect' => env('MASTODON_REDIRECT'), //'read', 'write', 'follow' - 'scopes' => ['read', 'write', 'follow'], + 'scopes' => ['read', 'write', 'follow'], ], ];