From baaee2d9876b9b446aea4feaa0f7db982712a793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20St=C3=B6ckel?= Date: Sat, 18 Jan 2025 01:12:21 +0100 Subject: [PATCH] :bug: fix error handling on registration via mastodon --- app/Http/Controllers/Frontend/Social/MastodonController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Frontend/Social/MastodonController.php b/app/Http/Controllers/Frontend/Social/MastodonController.php index 8d3ffc8a9..e8f82c526 100644 --- a/app/Http/Controllers/Frontend/Social/MastodonController.php +++ b/app/Http/Controllers/Frontend/Social/MastodonController.php @@ -69,6 +69,10 @@ public function callback(): RedirectResponse { config(['services.mastodon.client_id' => $server->client_id]); config(['services.mastodon.client_secret' => $server->client_secret]); + if (request()->has('error')) { + return redirect()->route('login')->with('error', \request('error_description')); + } + $socialiteUser = Socialite::driver(driver: 'mastodon')->user(); $user = MastodonBackend::getUserFromSocialite($socialiteUser, $server); if (!auth()->check()) {