Ensure I validate before attempting to update password for reset password flow. Send some validation issues back to FE.

This commit is contained in:
Joseph Milazzo 2021-03-13 12:28:00 -06:00
parent 52b91a9b92
commit 983078de02
3 changed files with 30 additions and 9 deletions

View file

@ -31,13 +31,10 @@ namespace API.Services
public void EnsureCacheDirectory()
{
// TODO: Replace with DirectoryService.ExistOrCreate()
_logger.LogDebug("Checking if valid Cache directory: {CacheDirectory}", CacheDirectory);
var di = new DirectoryInfo(CacheDirectory);
if (!di.Exists)
if (_directoryService.ExistOrCreate(CacheDirectory))
{
_logger.LogError("Cache directory {CacheDirectory} is not accessible or does not exist. Creating...", CacheDirectory);
Directory.CreateDirectory(CacheDirectory);
}
}