A class-action lawsuit has been filed against Twitter over Elon Musk’s plan to sack thousands of staffers — as employees were abruptly locked out of their company Slack and email accounts, and barred from going into the office ahead of the mass layoffs Friday.

The lawsuit was filed Thursday in San Francisco federal court after the company notified employees it would eliminate some 3,700 jobs, half its workforce, Bloomberg News reported.

It alleges that employees weren’t given enough notice of the mass layoffs in violation of federal and California law.

It seeks an order requiring the social media platform to obey the WARN Act — the Worker Adjustment and Retraining Notification Act, a federal law requiring companies with 100 or more workers to give 60 days’ notice of mass layoffs or other work disruptions.

The suit also wants the court to restrict Twitter from soliciting staffers to sign documents that could give up their right to take part in litigation, according to the news outlet.

“We filed this lawsuit tonight in an attempt to make sure that employees are aware that they should not sign away their rights and that they have an avenue for pursuing their rights,” Shannon Liss-Riordan, the attorney who filed the lawsuit, told Bloomberg.

Twitter didn’t immediately respond to a request for comment by Bloomberg.