public async Task <IActionResult> ChangeCachePolicy(CachePolicy selectedPolicy, int?invalidateCacheTime = null) { if (selectedPolicy != CachePolicy.NeverPolicy && invalidateCacheTime == null) { return(BadRequest(ErrorView.ValidationError())); } try { await cacheSettingsManager.UpdateCachePolicy(new CacheSettings() { CachePolicy = selectedPolicy, InvalidateCacheTime = invalidateCacheTime }); return(Ok()); } catch (ArgumentOutOfRangeException) { return(BadRequest(ErrorView.ValidationError())); } catch (NotFoundDataException) { return(BadRequest(ErrorView.ServerError())); } }
public async Task <IActionResult> ResetPasswordSetNew(string uid, string token, string newPassword) { var user = await userManager.FindByIdAsync(uid); var result = await userManager.ResetPasswordAsync(user, token, newPassword); if (result.Succeeded) { return(Ok()); } return(BadRequest(ErrorView.ServerError())); }