From 25b0c8e35452b292981c46e22402b3ea70993884 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 24 Oct 2024 20:49:20 +0200 Subject: [PATCH] Refactor license and OAuth settings to redirect non-admin users to home page --- app/Livewire/Settings/License.php | 3 +++ app/Livewire/SettingsOauth.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/Livewire/Settings/License.php b/app/Livewire/Settings/License.php index ca0c9c1ae..8cb7aad8f 100644 --- a/app/Livewire/Settings/License.php +++ b/app/Livewire/Settings/License.php @@ -28,6 +28,9 @@ public function mount() if (! isCloud()) { abort(404); } + if (! isInstanceAdmin()) { + return redirect()->route('home'); + } $this->instance_id = config('app.id'); $this->settings = instanceSettings(); } diff --git a/app/Livewire/SettingsOauth.php b/app/Livewire/SettingsOauth.php index c3884589f..17b3b89a3 100644 --- a/app/Livewire/SettingsOauth.php +++ b/app/Livewire/SettingsOauth.php @@ -24,6 +24,9 @@ protected function rules() public function mount() { + if (! isInstanceAdmin()) { + return redirect()->route('home'); + } $this->oauth_settings_map = OauthSetting::all()->sortBy('provider')->reduce(function ($carry, $setting) { $carry[$setting->provider] = $setting;