public async Task <OrganizationUserResetPasswordDetailsResponseModel> GetResetPasswordDetails(string orgId, string id) { // Make sure the calling user can reset passwords for this org var orgGuidId = new Guid(orgId); if (!_currentContext.ManageResetPassword(orgGuidId)) { throw new NotFoundException(); } var organizationUser = await _organizationUserRepository.GetByIdAsync(new Guid(id)); if (organizationUser == null || !organizationUser.UserId.HasValue) { throw new NotFoundException(); } // Retrieve data necessary for response (KDF, KDF Iterations, ResetPasswordKey) // TODO Revisit this and create SPROC to reduce DB calls var user = await _userService.GetUserByIdAsync(organizationUser.UserId.Value); if (user == null) { throw new NotFoundException(); } return(new OrganizationUserResetPasswordDetailsResponseModel(new OrganizationUserResetPasswordDetails(organizationUser, user))); }