public function socialCallback(Request $request, $serviceName)
    {
        try {
            $this->setDynamicRedirectUrl($serviceName);
            $user = $this->socialite->driver($serviceName)->user();
            $this->authService->login($serviceName, $user);
            return redirect(session('url.intended', '/'));
        } catch (\Exception $e) {
            Log::error('Social login failed: ' . $e->getMessage() . ' - ' . print_r($request->all(), true));
            if (session()->has('url.intended')) { // If redirect url exists show translated error to the user
                $reditectUrl = session('url.intended');
                session()->forget('url.intended'); // remove intended url
                // Set flash message
                session()->flash(
                    'messages',
                    [
                        [
                            'code' => 'error',
                            'text' => $e->getMessage()
                        ]
                    ]
                );
                return redirect($reditectUrl);
            } else {
                return app()->abort(500, $e->getMessage());
            }
        }
    }