From 523f13512e8ba6b61b12030220cd41a93644358c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 11 Oct 2021 11:13:40 +0200 Subject: [PATCH] wip #4765 --- composer.lock | 12 ++++++------ src/Http/Controllers/SocialiteController.php | 12 ++++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 9aa864a..26b0a27 100644 --- a/composer.lock +++ b/composer.lock @@ -2620,16 +2620,16 @@ }, { "name": "ramsey/collection", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa" + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/eaca1dc1054ddd10cbd83c1461907bee6fb528fa", - "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa", + "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", "shasum": "" }, "require": { @@ -2683,7 +2683,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.1" + "source": "https://github.com/ramsey/collection/tree/1.2.2" }, "funding": [ { @@ -2695,7 +2695,7 @@ "type": "tidelift" } ], - "time": "2021-08-06T03:41:06+00:00" + "time": "2021-10-10T03:01:02+00:00" }, { "name": "ramsey/uuid", diff --git a/src/Http/Controllers/SocialiteController.php b/src/Http/Controllers/SocialiteController.php index fd8c4dc..eed3f91 100644 --- a/src/Http/Controllers/SocialiteController.php +++ b/src/Http/Controllers/SocialiteController.php @@ -30,11 +30,15 @@ class SocialiteController extends Controller { $provider = request()->provider; if (in_array($provider, $this->providers, true)) { - $user = Socialite::driver($provider)->user(); - $authUser = $this->findOrCreateUser($user, $provider); + try { + $user = Socialite::driver($provider)->user(); + $authUser = $this->findOrCreateUser($user, $provider); - Auth::login($authUser, true); - return redirect('/test'); + Auth::login($authUser, true); + return redirect('/test'); + } catch (\Exception $e) { + $this->redirect(); + } } } -- 2.39.5