From 293dfb27da1f00f9822278eed0e42981825e3b1f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 18 Jan 2022 14:10:10 +0100 Subject: [PATCH] wip #5037 @0.25 --- .idea/runConfigurations.xml | 10 ---------- src/Http/Controllers/SocialiteController.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Http/Controllers/SocialiteController.php b/src/Http/Controllers/SocialiteController.php index 7f7c885..63d7201 100644 --- a/src/Http/Controllers/SocialiteController.php +++ b/src/Http/Controllers/SocialiteController.php @@ -5,6 +5,7 @@ namespace Cubist\Socialite\Http\Controllers; use Cubist\Socialite\CubistSocialiteServiceProvider; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Log; use Laravel\Socialite\Facades\Socialite; class SocialiteController extends Controller @@ -21,6 +22,15 @@ class SocialiteController extends Controller Auth::login($authUser, true); return redirect('/'); } catch (\Exception $e) { + // We are getting the directory so we can filter out any vendor code, + // along with the directory, so it looks better for the developer. + $dir = substr(__DIR__,0,-14); + $backtrace = $e->getTraceAsString(); + $backtrace = str_replace([$dir],"", $backtrace); + $backtrace = preg_replace('^(.*vendor.*)\n^','',$backtrace); + + // And finally, we log the exception! + Log::error('@here'.PHP_EOL.':warning: :x: :warning: :x: ' . PHP_EOL . '**Error:** '.$e->getMessage() . PHP_EOL. '**Line:** ' . $e->getLine() . PHP_EOL. '**File:** '. $e->getFile() . PHP_EOL . '**Trace:**'.PHP_EOL. $backtrace); return Socialite::driver($provider)->stateless()->redirect(); } } -- 2.39.5