mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
Create new file when adding license file and updating (#2092)
This commit is contained in:
parent
231eb84e69
commit
1a89056c61
@ -729,7 +729,7 @@ namespace Bit.Core.Services
|
||||
|
||||
var dir = $"{_globalSettings.LicenseDirectory}/organization";
|
||||
Directory.CreateDirectory(dir);
|
||||
using var fs = System.IO.File.OpenWrite(Path.Combine(dir, $"{organization.Id}.json"));
|
||||
await using var fs = new FileStream(Path.Combine(dir, $"{organization.Id}.json"), FileMode.Create);
|
||||
await JsonSerializer.SerializeAsync(fs, license, JsonHelpers.Indented);
|
||||
return result;
|
||||
}
|
||||
@ -915,7 +915,7 @@ namespace Bit.Core.Services
|
||||
|
||||
var dir = $"{_globalSettings.LicenseDirectory}/organization";
|
||||
Directory.CreateDirectory(dir);
|
||||
using var fs = System.IO.File.OpenWrite(Path.Combine(dir, $"{organization.Id}.json"));
|
||||
await using var fs = new FileStream(Path.Combine(dir, $"{organization.Id}.json"), FileMode.Create);
|
||||
await JsonSerializer.SerializeAsync(fs, license, JsonHelpers.Indented);
|
||||
|
||||
organization.Name = license.Name;
|
||||
|
Loading…
Reference in New Issue
Block a user