Skip to content

Commit

Permalink
bug 64979
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimChegulov committed Nov 28, 2023
1 parent 1f9e189 commit ef0fea8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class InvitationLinkService
private readonly CountPaidUserChecker _countPaidUserChecker;
private readonly FileSecurity _fileSecurity;
private readonly UserManager _userManager;
private readonly IPSecurity.IPSecurity _iPSecurity;

public InvitationLinkService(
CommonLinkUtility commonLinkUtility,
Expand All @@ -48,7 +49,8 @@ public InvitationLinkService(
TenantManager tenantManager,
CountPaidUserChecker countPaidUserChecker,
FileSecurity fileSecurity,
UserManager userManager)
UserManager userManager,
IPSecurity.IPSecurity iPSecurity)
{
_commonLinkUtility = commonLinkUtility;
_daoFactory = daoFactory;
Expand All @@ -58,6 +60,7 @@ public InvitationLinkService(
_countPaidUserChecker = countPaidUserChecker;
_fileSecurity = fileSecurity;
_userManager = userManager;
_iPSecurity = iPSecurity;
}

public string GetInvitationLink(Guid linkId, Guid createdBy)
Expand Down Expand Up @@ -97,6 +100,11 @@ public async Task<string> GetInvitationLinkAsync(string email, EmployeeType empl

public async Task<Validation> ValidateAsync(string key, string email, EmployeeType employeeType, string roomId = default)
{
if (!await _iPSecurity.VerifyAsync())
{
throw new SecurityException();
}

var linkData = await GetProcessedLinkDataAsync(key, email, employeeType);
var result = new Validation { Result = linkData.Result };

Expand Down

0 comments on commit ef0fea8

Please sign in to comment.