mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-20 04:23:16 +00:00
fix(team): improve team retrieval and session handling for users
This commit is contained in:
1 parent
ddd78658e8
commit
8d212bc110
4 files changed
+22
-5
No files matched your search
@@ -319,6 +319,14 @@ class User extends Authenticatable implements SendsEmail
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if user actually belongs to this team
|
||||
if (! $this->teams->contains('id', $sessionTeamId)) {
|
||||
session()->forget('currentTeam');
|
||||
Cache::forget('user:'.$this->id.':team:'.$sessionTeamId);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return Cache::remember('user:'.$this->id.':team:'.$sessionTeamId, 3600, function () use ($sessionTeamId) {
|
||||
return Team::find($sessionTeamId);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user