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 917d34a commit e2828d3
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 @@ -14,6 +14,7 @@
use JoelButcher\Socialstream\Contracts\UpdatesConnectedAccounts;
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;
Expand Down Expand Up @@ -134,7 +135,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'
Expand Down

0 comments on commit e2828d3

Please sign in to comment.