Skip to content

Commit

Permalink
🐛 fix error handling on registration via mastodon (#3169)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Jan 18, 2025
1 parent edb6955 commit 8db3fe8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/Frontend/Social/MastodonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 8db3fe8

Please sign in to comment.