An example of a near-restriction is Washington's RCW 49.44.200, which prohibits an employer from "Request[ing], requir[ing], or otherwise coerc[ing]" an employee or applicant to disclose "login information" for a social media account, or require the person to access the account in a way that the employer can see the content of that account. "Login information" is defined as "a user name and password, a password, or other means of authentication that protects access to a personal social networking account" – so "user6726" is not login information. I could legallyIt would be requiredlegal to require me to reveal my SE username, in Washington. The same kind of law exists in Arkansas. California law is different – an employee may not require or request an employee to "Disclose a username or password". Colorado law is similar.
I have no idea if the various state legislatures intended this difference, or if they simply are unaware that "and" and "or" mean different things.