Congress passed a law that would require any president to seek approval before the US could leave NATO.