bugfix: a new flow added to disable staffs and free the used seats.
This commit is contained in:
@@ -756,18 +756,7 @@ export class AuthService {
|
||||
throw new UnauthorizedException('Access denied to this organization');
|
||||
}
|
||||
if (!membership.isOwner && !membership.isActive) {
|
||||
const acceptedInvite = await this.prisma.staffInvitation.findFirst({
|
||||
where: {
|
||||
membershipId: membership.id,
|
||||
acceptedAt: { not: null },
|
||||
},
|
||||
select: { id: true },
|
||||
});
|
||||
throw new UnauthorizedException(
|
||||
acceptedInvite
|
||||
? 'Your access to this organization has been disabled.'
|
||||
: 'Your invitation is still pending activation.',
|
||||
);
|
||||
throw new UnauthorizedException('Your invitation is still pending activation');
|
||||
}
|
||||
|
||||
// 2. Build payload WITH org context
|
||||
|
||||
Reference in New Issue
Block a user