Add checks for placeholder invitation; Fixed bug in member deletion

This commit is contained in:
Constantin Graf
2025-07-07 16:54:26 +02:00
parent b0e638c28b
commit 9cb3aea7be
11 changed files with 186 additions and 16 deletions

View File

@@ -43,7 +43,10 @@ class Controller extends BaseController
/** @var Member|null $member */
$member = Member::query()->whereBelongsTo($organization, 'organization')->whereBelongsTo($user, 'user')->first();
if ($member === null) {
Log::error('This function should only be called in authenticated context after checking the user is a member of the organization');
Log::error('This function should only be called in authenticated context after checking the user is a member of the organization', [
'user' => $user->getKey(),
'organization' => $organization->getKey(),
]);
throw new AuthorizationException;
}