Skip to content

Commit

Permalink
only handle registration if the feature is enabled in Fortify
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Butcher committed Mar 18, 2021
1 parent f030f3d commit 4cf91da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Controllers/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Illuminate\Support\Facades\Auth;
use JoelButcher\Socialstream\Contracts\CreatesUserFromProvider;
use JoelButcher\Socialstream\Contracts\HandlesInvalidState;
use Laravel\Fortify\Features as FortifyFeatures;
use Laravel\Jetstream\Jetstream;
use Laravel\Socialite\Contracts\User as SocialiteUserContract;
use Laravel\Socialite\Facades\Socialite;
Expand Down Expand Up @@ -103,7 +104,7 @@ public function handleProviderCallback(Request $request, string $provider, Handl
}

// Registration...
if (session()->get('origin_url') === route('register')) {
if (FortifyFeatures::enabled(FortifyFeatures::registration()) && session()->get('origin_url') === route('register')) {
if ($account) {
return redirect()->route('register')->withErrors(
__('An account with that :Provider sign in already exists, please login.', ['provider' => $provider])
Expand Down

0 comments on commit 4cf91da

Please sign in to comment.