Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] fix auth redirects #387

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Http/Responses/OAuthLoginResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function toResponse($request): RedirectResponse|FortifyLoginResponse
config('socialstream.filament-route', 'filament.admin.pages.dashboard')
),
$this->hasComposerPackage('laravel/jetstream') => $this->fortifyResponse($request),
$this->hasComposerPackage('laravel/breeze') => redirect()->route('dashboard'),
default => $this->defaultResponse(),
};
}
Expand All @@ -40,6 +39,6 @@ private function defaultResponse(): RedirectResponse
{
return Socialstream::redirects('login')
? redirect()->intended(Socialstream::redirects('login'))
: redirect()->to(route('dashboard', absolute: false));
: redirect()->to(config('socialstream.home'));
}
}
3 changes: 1 addition & 2 deletions src/Http/Responses/OAuthRegisterResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function toResponse($request): RedirectResponse|RegisterResponse
config('socialstream.filament-route', 'filament.admin.pages.dashboard')
),
$this->hasComposerPackage('laravel/jetstream') => $this->fortifyResponse($request),
$this->hasComposerPackage('laravel/breeze') => redirect()->route('dashboard'),
default => $this->defaultResponse(),
};
}
Expand All @@ -41,6 +40,6 @@ private function defaultResponse(): RedirectResponse
{
return Socialstream::redirects('register')
? redirect()->intended(Socialstream::redirects('register'))
: redirect()->to(route('dashboard', absolute: false));
: redirect()->to(config('socialstream.home'));
}
}
5 changes: 4 additions & 1 deletion src/Socialstream.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ public static function providers(): array
*/
public static function redirects(string $redirect, mixed $default = null)
{
return config('socialstream.redirects.'.$redirect) ?? $default ?? config('socialstream.home');
return config(
key: "socialstream.redirects.$redirect",
default: $default ?? config('socialstream.home')
);
}

/**
Expand Down
Loading