mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-16 10:15:05 +00:00
fix(sources): prevent 500 when deleting GitLab/GitHub apps
After delete, Livewire still re-renders the source change view (modal $refresh / morph). Policy @can checks then call isAdminOfTeam() with a null team_id and throw a TypeError (HTTP 500) before the redirect. Guard null team_id in GitlabAppPolicy and GithubAppPolicy, clear the Livewire model after delete, and skip @can when the model is gone.
This commit is contained in:
1 parent
f06bacc8e0
commit
5b370713c3
9 files changed
+150
-41
No files matched your search
@@ -478,6 +478,9 @@ class Change extends Component
|
||||
return;
|
||||
}
|
||||
$this->github_app->delete();
|
||||
// Clear so post-delete Livewire re-render / modal $refresh does not re-run
|
||||
// @can and canGate checks against a deleted model (null team_id TypeError).
|
||||
$this->github_app = null;
|
||||
|
||||
return redirect()->route('source.all');
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in new issue
Block a user