Skip to content

Commit

Permalink
Add error message if revoked user tries to accept invite (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat authored Sep 7, 2022
1 parent edcac75 commit c085f5d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/Services/Implementations/OrganizationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,11 @@ public async Task<OrganizationUser> AcceptUserAsync(string orgIdentifier, User u
private async Task<OrganizationUser> AcceptUserAsync(OrganizationUser orgUser, User user,
IUserService userService)
{
if (orgUser.Status == OrganizationUserStatusType.Revoked)
{
throw new BadRequestException("Your organization access has been revoked.");
}

if (orgUser.Status != OrganizationUserStatusType.Invited)
{
throw new BadRequestException("Already accepted.");
Expand Down

0 comments on commit c085f5d

Please sign in to comment.