The Privileges and Immunities clause of the Fourteenth Amendment, more or less.
This works just fine in other contexts. Eg. when you move to Alaska, you only start getting your Permanent Fund dividend only when you’re Alaskan resident for a full calendar year. You are only eligible for resident hunting permit after 12 months of residency. There are many more examples.