fix: registration
fix: user deletion
This commit is contained in:
parent
949407368e
commit
9f2fbc661a
@ -12,7 +12,6 @@ public function delete()
|
||||
$currentTeam = currentTeam();
|
||||
$currentTeam->delete();
|
||||
|
||||
$team = auth()->user()->teams()->first();
|
||||
$currentTeam->members->each(function ($user) use ($currentTeam) {
|
||||
if ($user->id === auth()->user()->id) {
|
||||
return;
|
||||
|
@ -78,7 +78,7 @@ public function isAdminFromSession()
|
||||
if ($is_part_of_root_team && $is_admin_of_root_team) {
|
||||
return true;
|
||||
}
|
||||
$role = $teams->where('id', auth()->user()->id)->first()->pivot->role;
|
||||
$role = $teams->where('id', session('currentTeam')->id)->first()->pivot->role;
|
||||
return $role === 'admin' || $role === 'owner';
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Team;
|
||||
use App\Models\User;
|
||||
use App\Notifications\Channels\DiscordChannel;
|
||||
use App\Notifications\Channels\EmailChannel;
|
||||
use App\Notifications\Channels\TelegramChannel;
|
||||
@ -60,7 +61,7 @@ function showBoarding(): bool
|
||||
function refreshSession(?Team $team = null): void
|
||||
{
|
||||
if (!$team) {
|
||||
$team = Team::find(currentTeam()->id);
|
||||
$team = User::find(auth()->user()->id)->teams->first();
|
||||
}
|
||||
Cache::forget('team:' . auth()->user()->id);
|
||||
Cache::remember('team:' . auth()->user()->id, 3600, function() use ($team) {
|
||||
|
Loading…
Reference in New Issue
Block a user