mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update Discover, allow public discover access
This commit is contained in:
parent
9fd90e174b
commit
1404ac6e6f
2 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,7 @@ class DiscoverController extends Controller
|
||||||
|
|
||||||
public function home(Request $request)
|
public function home(Request $request)
|
||||||
{
|
{
|
||||||
abort_if(!Auth::check(), 403);
|
abort_if(!Auth::check() && config('instance.discover.public') == false, 403);
|
||||||
return view('discover.home');
|
return view('discover.home');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,8 @@ class DiscoverController extends Controller
|
||||||
|
|
||||||
public function trendingApi(Request $request)
|
public function trendingApi(Request $request)
|
||||||
{
|
{
|
||||||
|
abort_if(config('instance.discover.public') == false && !Auth::check(), 403);
|
||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'range' => 'nullable|string|in:daily,monthly'
|
'range' => 'nullable|string|in:daily,monthly'
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -10,6 +10,7 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
'discover' => [
|
'discover' => [
|
||||||
|
'public' => env('INSTANCE_DISCOVER_PUBLIC', false),
|
||||||
'loops' => [
|
'loops' => [
|
||||||
'enabled' => env('EXP_LOOPS', false),
|
'enabled' => env('EXP_LOOPS', false),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue