From cee500cb804b4c51449b707194fa9726a617e1e5 Mon Sep 17 00:00:00 2001 From: Joel Butcher Date: Wed, 11 Sep 2024 11:30:45 +0100 Subject: [PATCH] check if came from filament first --- src/Http/Responses/OAuthLoginResponse.php | 2 +- src/Http/Responses/OAuthRegisterResponse.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Responses/OAuthLoginResponse.php b/src/Http/Responses/OAuthLoginResponse.php index 1bf2e7c..f761d24 100644 --- a/src/Http/Responses/OAuthLoginResponse.php +++ b/src/Http/Responses/OAuthLoginResponse.php @@ -20,7 +20,7 @@ class OAuthLoginResponse implements LoginResponseContract public function toResponse($request): RedirectResponse|FortifyLoginResponse { return match (true) { - $this->usesFilament() && $this->hasFilamentAuthRoutes() => redirect()->route( + $this->cameFromFilamentAuthRoute() && $this->usesFilament() && $this->hasFilamentAuthRoutes() => redirect()->route( config('socialstream.filament-route', 'filament.admin.pages.dashboard') ), $this->hasComposerPackage('laravel/jetstream') => $this->fortifyResponse($request), diff --git a/src/Http/Responses/OAuthRegisterResponse.php b/src/Http/Responses/OAuthRegisterResponse.php index 61a83dd..61a4878 100644 --- a/src/Http/Responses/OAuthRegisterResponse.php +++ b/src/Http/Responses/OAuthRegisterResponse.php @@ -21,7 +21,7 @@ class OAuthRegisterResponse implements RegisterResponseContract public function toResponse($request): RedirectResponse|RegisterResponse { return match (true) { - $this->usesFilament() && $this->hasFilamentAuthRoutes() => redirect()->route( + $this->cameFromFilamentAuthRoute() && $this->usesFilament() && $this->hasFilamentAuthRoutes() => redirect()->route( config('socialstream.filament-route', 'filament.admin.pages.dashboard') ), $this->hasComposerPackage('laravel/jetstream') => $this->fortifyResponse($request),