Two new privacy-focused bills has been signed into law in California that prohibit employers and universities from asking for social media usernames and passwords from employees, students, and potential hires.

“Today I am signing Assembly Bill 1844 and Senate Bill 1349, which prohibit universities and employers from demanding your email and social media passwords,” Calif. Gov. Jerry Brown wrote on his Facebook page. “California pioneered the social media revolution. These laws protect Californians from unwarranted invasions of their social media accounts.”

Calif. State Senator Leland Yee, a sponsor of SB 1349, said in an interview in May that he believed this practice could become more common because the tough job market. Employers have the upper hand over potential hires.

“You can imagine that people are desperate for jobs,” Yee said at the time. “They have to make ends meet, and when there are no prospects of a job or income coming in, then people are put in these kind of difficult positions and sometimes they should not. They know they should not, but then, unfortunately, they do turn that information over.”

Assemblymember Nora Campos, who wrote AB 1844, had previously described the bill as a “preemptive measure” that will give guidelines to employers and universities on how to go about asking for information related to social networks.

The federal government could pursue what California did next. In May, several Democratic senators introduced a bill called the Password Protection Act Of 2012. If passed, it would enhance current laws “to prohibit employers from compelling or coercing employees into providing access to their private accounts.”