In the United States, there is no right for the people to vote for president. Instead, only the "Electors" can vote.
According to Article 2 of the constitution:
Each State shall appoint, in such Manner as the Legislature thereof may direct, a Number of Electors, equal to the whole Number of Senators and Representatives to which the State may be entitled in the Congress
and as held by the Supreme Court in Bush v Gore :
The individual citizen has no federal constitutional right to vote for electors for the President of the United States unless and until the state legislature chooses a statewide election as the means to implement its power to appoint members of the electoral college. U. S. Const., Art. II, § 1. This is the source for the statement in McPherson v. Blacker, 146 U. S. 1, 35 (1892), that the state legislature's power to select the manner for appointing electors is plenary; it may, if it so chooses, select the electors itself, which indeed was the manner used by state legislatures in several States for many years after the framing of our Constitution. Id., at 28-33. History has now favored the voter, and in each of the several States the citizens themselves vote for Presidential electors. When the state legislature vests the right to vote for President in its people, the right to vote as the legislature has prescribed is fundamental; and one source of its fundamental nature lies in the equal weight accorded to each vote and the equal dignity owed to each voter. The State, of course, after granting the franchise in the special context of Article II, can take back the power to appoint electors. See id., at 35 (" '[T]here is no doubt of the right of the legislature to resume the power at any time, for it can neither be taken away nor abdicated'")
and
"[t]he [State's] legislative power is the supreme authority except as limited by the constitution of the State." Ibid.; cf. Smiley v. Holm, 285 U. S. 355, 367 (1932).
So the state legislatures could exercise their (federal) constitutional power to select only Electors that support a particular candidate, but the Electors themselves have the actual power to vote for president and vice-president. It is not "automatic", although there are ongoing Supreme Court cases concerning the degree to which a state can remove or punish Electors for voting for the “wrong” candidate. Also, the state legislatures need to follow their state's constitutions in doing so.
See also 3 U.S. Code § 5. Determination of controversy as to appointment of electors :
If any State shall have provided, by laws enacted prior to the day fixed for the appointment of the electors, for its final determination of any controversy or contest concerning the appointment of all or any of the electors of such State, by judicial or other methods or procedures, and such determination shall have been made at least six days before the time fixed for the meeting of the electors, such determination made pursuant to such law so existing on said day, and made at least six days prior to said time of meeting of the electors, shall be conclusive, and shall govern in the counting of the electoral votes as provided in the Constitution, and as hereinafter regulated, so far as the ascertainment of the electors appointed by such State is concerned.