Buhari, who was first elected in 2015, had initially rejected the new law over its inclusion of primaries to choose candidates, claiming it would infringe on party bylaws and lead to insecurity during the polls.
He asked the national assembly to delete one provision in the law which would have barred political appointees from running in elections.
Buhari, a former military ruler, will step down after serving two four-year terms, and political leaders are already manoeuvring for position before the February 2023 ballot.