switch to auth()->user from session

This commit is contained in:
Andras Bacsai
2023-08-11 17:31:53 +02:00
parent e60ec6c47e
commit 833e45155d
32 changed files with 90 additions and 77 deletions

View File

@@ -158,8 +158,8 @@ function refreshPrivateKey(PrivateKey $private_key)
foreach ($private_key->servers as $server) {
// Delete the old ssh mux file to force a new one to be created
Storage::disk('ssh-mux')->delete($server->muxFilename());
if (session('currentTeam')->id) {
session('currentTeam')->privateKeys = PrivateKey::where('team_id', session('currentTeam')->id)->get();
if (auth()->user()->currentTeam()->id) {
auth()->user()->currentTeam()->privateKeys = PrivateKey::where('team_id', auth()->user()->currentTeam()->id)->get();
}
}
}