diff --git a/products/ASC.Files/Core/Core/FileStorageService.cs b/products/ASC.Files/Core/Core/FileStorageService.cs index e02c0aa51f..d21216e12a 100644 --- a/products/ASC.Files/Core/Core/FileStorageService.cs +++ b/products/ASC.Files/Core/Core/FileStorageService.cs @@ -1225,7 +1225,7 @@ namespace ASC.Web.Files.Services.WCFService } catch (Exception e) { - throw GenerateException(e); + throw GenerateException(e.InnerException ?? e); } } else diff --git a/products/ASC.Files/Core/Core/Thirdparty/ProviderAccountDao.cs b/products/ASC.Files/Core/Core/Thirdparty/ProviderAccountDao.cs index 25065a381e..c2423c2f26 100644 --- a/products/ASC.Files/Core/Core/Thirdparty/ProviderAccountDao.cs +++ b/products/ASC.Files/Core/Core/Thirdparty/ProviderAccountDao.cs @@ -367,7 +367,9 @@ namespace ASC.Files.Thirdparty { Id = id, Title = customerTitle, - Token = EncryptPassword(authData.Token), + Token = EncryptPassword(authData.Token), + Url = authData.Url, + UserName = authData.Login, Password = EncryptPassword(authData.Password), UserId = owner, FolderType = type, @@ -390,10 +392,11 @@ namespace ASC.Files.Thirdparty var createOn = TenantUtil.DateTimeFromUtc(input.CreateOn); var authData = new AuthData(input.Url, input.UserName, DecryptPassword(input.Password), token); - if (string.IsNullOrEmpty(token)) throw new ArgumentException("Token can't be null"); - if (key == ProviderTypes.Box) - { + { + if (string.IsNullOrEmpty(token)) + throw new ArgumentException("Token can't be null"); + var box = ServiceProvider.GetService(); box.ID = id; box.CustomerTitle = providerTitle; @@ -406,7 +409,10 @@ namespace ASC.Files.Thirdparty } if (key == ProviderTypes.DropboxV2) - { + { + if (string.IsNullOrEmpty(token)) + throw new ArgumentException("Token can't be null"); + var drop = ServiceProvider.GetService(); drop.ID = id; drop.CustomerTitle = providerTitle; @@ -436,7 +442,10 @@ namespace ASC.Files.Thirdparty } if (key == ProviderTypes.GoogleDrive) - { + { + if (string.IsNullOrEmpty(token)) + throw new ArgumentException("Token can't be null"); + var gd = ServiceProvider.GetService(); gd.ID = id; gd.CustomerTitle = providerTitle; @@ -450,7 +459,10 @@ namespace ASC.Files.Thirdparty } if (key == ProviderTypes.OneDrive) - { + { + if (string.IsNullOrEmpty(token)) + throw new ArgumentException("Token can't be null"); + var od = ServiceProvider.GetService(); od.ID = id; od.CustomerTitle = providerTitle;