diff --git a/src/Actions/AuthenticateOAuthCallback.php b/src/Actions/AuthenticateOAuthCallback.php index 0256bf9..c07ecab 100644 --- a/src/Actions/AuthenticateOAuthCallback.php +++ b/src/Actions/AuthenticateOAuthCallback.php @@ -207,11 +207,18 @@ private function canRegister(mixed $user, mixed $account): bool return false; } + if ($this->hasComposerPackage('filament/filament')) { + return (Route::has('filament.auth.login') && Session::get('socialstream.previous_url') === route('filament.auth.login')) || + (Route::has('filament.admin.auth.login') && Session::get('socialstream.previous_url') === route('filament.admin.auth.login')) || + (Route::has('filament.auth.register') && Session::get('socialstream.previous_url') === route('filament.auth.register')) || + (Route::has('filament.admin.auth.register') && Session::get('socialstream.previous_url') === route('filament.admin.auth.register')); + } + if (Route::has('register') && Session::get('socialstream.previous_url') === route('register')) { return true; } - if (Session::get('socialstream.previous_url') !== route('login')) { + if (Route::has('login') && Session::get('socialstream.previous_url') !== route('login')) { return Features::hasGlobalLoginFeatures(); }