diff --git a/products/ASC.Files/Core/ApiModels/ResponseDto/ExternalShareDto.cs b/products/ASC.Files/Core/ApiModels/ResponseDto/ExternalShareDto.cs index d3695fcf3f..54508099f0 100644 --- a/products/ASC.Files/Core/ApiModels/ResponseDto/ExternalShareDto.cs +++ b/products/ASC.Files/Core/ApiModels/ResponseDto/ExternalShareDto.cs @@ -63,4 +63,7 @@ public class ExternalShareDto : IMapFrom /// Link ID /// public Guid LinkId { get; set; } + + /// Specifies whether the user is authenticated or not + public bool IsAuthenticated { get; set; } } \ No newline at end of file diff --git a/products/ASC.Files/Core/Core/Security/ExternalShare.cs b/products/ASC.Files/Core/Core/Security/ExternalShare.cs index e972a6832d..7f267c6469 100644 --- a/products/ASC.Files/Core/Core/Security/ExternalShare.cs +++ b/products/ASC.Files/Core/Core/Security/ExternalShare.cs @@ -376,6 +376,10 @@ public class ValidationInfo /// Link ID /// System.Guid, System public Guid LinkId { get; set; } + + /// Specifies whether the user is authenticated or not + /// System.Boolean, System + public bool IsAuthenticated { get; set; } } public record DownloadSession diff --git a/products/ASC.Files/Core/Helpers/ExternalLinkHelper.cs b/products/ASC.Files/Core/Helpers/ExternalLinkHelper.cs index 0d58e4f277..ef3fbaae0a 100644 --- a/products/ASC.Files/Core/Helpers/ExternalLinkHelper.cs +++ b/products/ASC.Files/Core/Helpers/ExternalLinkHelper.cs @@ -46,6 +46,9 @@ public async Task ValidateAsync(string key, string password = nu Status = Status.Invalid, Access = FileShare.Restrict }; + + var isAuth = securityContext.IsAuthenticated; + result.IsAuthenticated = isAuth; var data = await externalShare.ParseShareKeyAsync(key); var securityDao = daoFactory.GetSecurityDao(); @@ -55,8 +58,6 @@ public async Task ValidateAsync(string key, string password = nu { return result; } - - var isAuth = securityContext.IsAuthenticated; var status = await externalShare.ValidateRecordAsync(record, password, isAuth); result.Status = status;