This is perfectly within the right of the State Legislature.
The Constitution Article II Section 1 Paragraph 2
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: but no Senator or Representative, or Person holding an Office of Trust or Prof-it under the United States, shall be appointed an Elector.
This is perfectly within the right of the State Legislature.
The Constitution Article II Section 1 Paragraph 2
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: but no Senator or Representative, or Person holding an Office of Trust or Prof-it under the United States, shall be appointed an Elector.