]> _ Git - cubist_socialite.git/commitdiff
wip #5037 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 18 Jan 2022 13:10:10 +0000 (14:10 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 18 Jan 2022 13:10:10 +0000 (14:10 +0100)
.idea/runConfigurations.xml [deleted file]
src/Http/Controllers/SocialiteController.php

diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644 (file)
index 797acea..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RunConfigurationProducerService">
-    <option name="ignoredProducers">
-      <set>
-        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
-      </set>
-    </option>
-  </component>
-</project>
\ No newline at end of file
index 7f7c885ef33589bf9cbb3fd8b84e77b095cc5180..63d7201b69d2ae8f262b94fbfcdeade31923f5a9 100644 (file)
@@ -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();
             }
         }