|
|
|
@ -54,7 +54,8 @@ namespace Jellyfin.Server.Implementations.Users
|
|
|
|
|
foreach (var resetFile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{BaseResetFileName}*"))
|
|
|
|
|
{
|
|
|
|
|
SerializablePasswordReset spr;
|
|
|
|
|
await using (var str = AsyncFile.OpenRead(resetFile))
|
|
|
|
|
var str = AsyncFile.OpenRead(resetFile);
|
|
|
|
|
await using (str.ConfigureAwait(false))
|
|
|
|
|
{
|
|
|
|
|
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false)
|
|
|
|
|
?? throw new ResourceNotFoundException($"Provided path ({resetFile}) is not valid.");
|
|
|
|
@ -107,7 +108,8 @@ namespace Jellyfin.Server.Implementations.Users
|
|
|
|
|
UserName = user.Username
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await using (FileStream fileStream = AsyncFile.OpenWrite(filePath))
|
|
|
|
|
FileStream fileStream = AsyncFile.OpenWrite(filePath);
|
|
|
|
|
await using (fileStream.ConfigureAwait(false))
|
|
|
|
|
{
|
|
|
|
|
await JsonSerializer.SerializeAsync(fileStream, spr).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|