Merge pull request #3576 from peaklabs-dev/fix-api-enabeled

Fix: Disable API by default and do not allow API key creation when API is disabled
This commit is contained in:
Andras Bacsai
2024-09-27 16:46:21 +02:00
committed by GitHub
3 changed files with 74 additions and 58 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire\Security;
use App\Models\InstanceSettings;
use Livewire\Component;
class ApiTokens extends Component
@@ -16,13 +17,18 @@ class ApiTokens extends Component
public array $permissions = ['read-only'];
public $instanceSettings;
public function render()
{
return view('livewire.security.api-tokens');
return view('livewire.security.api-tokens', [
'instanceSettings' => $this->instanceSettings,
]);
}
public function mount()
{
$this->instanceSettings = InstanceSettings::get();
$this->tokens = auth()->user()->tokens->sortByDesc('created_at');
}