public async Task <IActionResult> ChangePassword([FromForm] ChangePasswordModel model) { if (!TryValidateModel(model)) { return(BadRequest()); } var reencryptedKeys = await _keysService.ReencryptNodeKeysAsync(NodeSettings.Configs.Node.Id, NodeSettings.Configs.Password, model.NewPassword).ConfigureAwait(false); NodeData.Instance.SetNodeKeys(reencryptedKeys.FirstOrDefault(key => key.KeyId == NodeData.Instance.NodeKeys.KeyId)); NodeSettings.Configs.Password = model.NewPassword; await NodeSettings.Configs.UpdateConfigurationFileAsync().ConfigureAwait(false); return(Redirect(nameof(Index))); }