Skip to content

Commit

Permalink
remove check for local env, fix route middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
heidkaemper committed Dec 6, 2023
1 parent b3f30a8 commit 77345cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

$config = [
'prefix' => config('statamic.toolbar.route_prefix', '_toolbar'),
'middleware' => [AuthGuard::class, ToolbarEnabled::class],
'middleware' => [
config('statamic.routes.middleware', 'web'),
AuthGuard::class,
ToolbarEnabled::class,
],
];

Route::group($config, function () {
Expand Down
6 changes: 1 addition & 5 deletions src/Controllers/ToolbarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ protected function getTemplate(): string|null

protected function getCpLink(): string|null
{
if (! config('statamic.toolbar.components.cp_link', true)) {
return null;
}

if (! auth()->check() && config('app.env') !== 'local') {
if (! config('statamic.toolbar.components.cp_link', true) || ! auth()->check()) {
return null;
}

Expand Down

0 comments on commit 77345cc

Please sign in to comment.