From 09fad4e4c88771f47b50b43b4fb3a2736e4bbadf Mon Sep 17 00:00:00 2001 From: Joel Butcher Date: Thu, 18 Mar 2021 07:24:56 +0000 Subject: [PATCH] only handle registration if the feature is enabled in Fortify --- src/Http/Controllers/OAuthController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Http/Controllers/OAuthController.php b/src/Http/Controllers/OAuthController.php index 7ac1fb19..ce9e53d6 100644 --- a/src/Http/Controllers/OAuthController.php +++ b/src/Http/Controllers/OAuthController.php @@ -13,6 +13,7 @@ use JoelButcher\Socialstream\Contracts\ResolvesSocialiteUsers; use JoelButcher\Socialstream\Features; use JoelButcher\Socialstream\Socialstream; +use Laravel\Fortify\Features as FortifyFeatures; use Laravel\Jetstream\Jetstream; use Laravel\Socialite\Facades\Socialite; use Laravel\Socialite\Two\InvalidStateException; @@ -124,7 +125,7 @@ public function handleProviderCallback(Request $request, string $provider, Resol } // Registration... - if (session()->get('socialstream.previous_url') === route('register')) { + if (FortifyFeatures::enabled(FortifyFeatures::registration()) && session()->get('socialstream.previous_url') === route('register')) { if ($account) { return redirect()->route('register')->withErrors( __('An account with that :Provider sign in already exists, please login.', ['provider' => $provider]), 'socialstream'